PDA

View Full Version : Solved: ROUND FUNCTION



stecstec
06-15-2006, 03:28 AM
Hi there,

This hopefully will be quick solution - I'm trying to use the Round function to have a result which should be displayed as a currency value. I've noticed sometimes that the result can be "30.5" - is there any why of tweaking the result so I get it as "30.50"?


n4 = Round((n4 / 12), 2)


Would appreciate a quick response on this! Many thanks, Steve.

fumei
06-15-2006, 05:06 AM
Try using FormatCurrency.

MsgBox FormatCurrency(32.5) will display $32.50

n4 = FormatCurrency(Round((n4 / 12), 2) )

stecstec
06-15-2006, 06:04 AM
Try using FormatCurrency.

MsgBox FormatCurrency(32.5) will display $32.50

n4 = FormatCurrency(Round((n4 / 12), 2) )

Thanks Gerry, unfortunately this doesnt seem to work for me - I still get 32.5

I've got n4 set as Double to allow the decimal places - would this be correct?

thanks again, Steve.

fumei
06-15-2006, 06:56 AM
No. Please post as full as possible code.

stecstec
06-15-2006, 08:29 AM
Gerry,

- have got the code to work, I didnt realise the output needed to be a string! (must be an off-day..)

Many thanks for your help on this. :friends:

Steve.

fumei
06-15-2006, 08:43 AM
Ah, yes...it is a string.