Normal Topic FormatMoney Rounding (Read 760 times)
tcgeo
Full Member
***
Offline



Posts: 278
Location: Traverse City, Michigan
Joined: May 13th, 2008
FormatMoney Rounding
Jul 16th, 2010 at 3:48pm
Print Post Print Post  
The tax applied to an LE called Labor is 8.625%

On the form, the Labor LE shows a figure of $105.23 and the Tax LE shows a rounded amount of $9.08, which is correct. ($9.0760 rounded)

When I use the code below, the tax amount printed is $9.07.

vTax = FormatMoney(@FormFieldValue("Invoice Subform", "Tax", vRecord))
PrintString(vTax, 700, vPageY, 100, "Arial", 14, 0, 1)

Can I force the tax amount to be rounded to two digits?

Thanks
  
Back to top
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: FormatMoney Rounding
Reply #1 - Jul 16th, 2010 at 4:56pm
Print Post Print Post  
Hello,

In the FormatMoney function it's probably using @Decimals() if you switch that to @Round() you should get the results you are after.

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
tcgeo
Full Member
***
Offline



Posts: 278
Location: Traverse City, Michigan
Joined: May 13th, 2008
Re: FormatMoney Rounding
Reply #2 - Jul 16th, 2010 at 5:15pm
Print Post Print Post  
Thank you Ray,

It's a beautiful thing!

Are you sure you're not Ray the Wizard?

Have a great weekend.

Brandon
  
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: FormatMoney Rounding
Reply #3 - Jul 16th, 2010 at 5:33pm
Print Post Print Post  
If you want to make sure that 5 always rounds in the same direction, you want to use @DefinedRound instead of @Round.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
tcgeo
Full Member
***
Offline



Posts: 278
Location: Traverse City, Michigan
Joined: May 13th, 2008
Re: FormatMoney Rounding
Reply #4 - Jul 16th, 2010 at 5:36pm
Print Post Print Post  
Ok, thank you Erika,

You have a great weekend as well.
  
Back to top
IP Logged