Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

change $0.6 to $0.60

Status
Not open for further replies.

gavray

Programmer
Jul 17, 2000
65
GB
Hi,

For some reason when I do a calculation with a loop in my shopping basket code, it knocks off the last 0. Which looks wrong for people. The unit price stays at $0.60 but immediately I do the code below isubtotal ends up as $0.6
I've tried round functions etc, but I can't find anything on web either to solve the prob,

thanks if you can help
----------------------------------------------
x=0
isubtotal = 0
For i = 1 to scartItem
x=x+1
isubtotal = isubtotal + arrCart(cUnitPrice,i)
next
--------------------------------------------------

the boho from soho
 
Have you tried formatNumber(blah, 2) or formatCurrency(blah, 2)?
 
FormatCurrency(isubtotal,2) will do as suggested by vongrunt.


-VJ
 
Thanks chaps,

Works perfectly....



the boho from soho
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top