I have this script which does a simple calculation and displays result in a window:
subtotal = 100.05;
discountPercent = 0.1;
discountAmount = subtotal * discountPercent;
totalBeforeTax = subtotal - discountAmount;
formattedMessage = Concat(
"Subtotal:",Repeat(" ",5), Format(subtotal, "Currency"), "\!n",
"Discount Percent:", Repeat(" ",5), Format(discountPercent, "Percent"), "\!n",
"Discount Amount:", Repeat(" ",5), Format(discountAmount, "Currency"), "\!n",
"Total before tax:", Repeat(" ",5), Format(totalBeforeTax, "Currency"), "\!n"
);
formattedMessageDisplay = New Window( "Result",
Lineup Box( N Col( 1 ), Spacing( 0, 0 ), Border Box( Left( 20 ), Right( 20 ), top( 20 ), bottom( 20 ),
Text Box( formattedMessage, <<SetFontSize( 14 ) ) )
),
Show(subtotal, discountAmount, totalBeforeTax)
);
It produces the following, in the log and the output window :
So using Format(totalBeforeTax, "Currency"), results in totalBeforeTax being "rounded up". I can think of a variety of ways of handling this, but wondered what would be most recommended.
PDB