How to round/truncate a calculated number in a receipt?

Hi, I implemented POS in Mexico, and to make a receipt call Factura I need to do the following calculation that is printed in currency format (xx.xxx):

-

- MarginBottom

- PaperHeight - MarginBottom - FooterHeight "Small" tbNone

- ">~" PageWidth " "

- Transaction.Type = transactionSales

-

- "Large" tbNone

- ">" PageWidth * 0.85 ""

- ">~" PageWidth * 0.15 "$"Transaction.SubTotal-(Transaction.SubTotal*15/115)

- " " "|" "|$" Transaction.SubTotal-(Transaction.SubTotal*100/115) "|" Transaction.Total " "

However, when I do the same for each entry it does not format the number and prints more than 10 decimals. Could anyone tell me how can I truncate or round the calculation below?

-

- ShowLineDiscounts & (Entry.ExtendedDiscountPurchased

0)

- Entry.Quantity "|" "" "|" Entry.Description "|$" Entry.FullPrice-(Entry.FullPrice*15/115) "|$"Entry.ExtendedFullPrice-(Entry.ExtendedFullPrice*15/115)

- Entry.DiscountNegative 0

- "|Discount||" Entry.DiscountNegative "|" Entry.ExtendedDiscountNegative

- Entry.Quantity "|" "" "|" Entry.Description "|$" Entry.FullPrice-(Entry.FullPrice*15/115) "|$" Entry.ExtendedFullPrice-(Entry.ExtendedFullPrice*15/115)

Regards

Reply to
-Ximena
Loading thread data ...

Try using the SQL Round function in the formula:

ROUND ( numeric_expression , length [ ,function ] ) Arguments numeric_expression Is an expression of the exact numeric or approximate numeric data type category, except for the bit data type.

length Is the precision to which numeric_expression is to be rounded. length must be an expression of type tinyint, smallint, or int. When length is a positive number, numeric_expression is rounded to the number of decimal positions specified by length. When length is a negative number, numeric_expression is rounded on the left side of the decimal point, as specified by length.

function Is the type of operation to perform. function must be tinyint, smallint, or int. When function is omitted or has a value of 0 (default), numeric_expression is rounded. When a value other than 0 is specified, numeric_expression is truncated.

"-Ximena" wrote:

Reply to
Matt Hurst

scratch that, the report doesn't have access to the Round function. Try setting an environment variable with that value, and then using the variable in the report instead:

Transacti> Try using the SQL Round function in the formula:

"$"Transaction.SubTotal-round(Transaction.SubTotal*15/115,3,0)

Reply to
Matt Hurst

BeanSmart website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.