Home: Perl Programming Help: Beginner:
Rounding Decimals


Mar 16, 2001, 9:04 AM

Views: 367
Rounding Decimals

Can someone tell me how to make a cgi round a decimal point. I have a program with some formulas in it that need to have the result displayed as currency with the leading zeros or what ever is after the decimal, but only two characters. (eg $12.59 instead of $12.59300235).

Administrator / Moderator

Mar 16, 2001, 12:03 PM

Views: 364
Re: Rounding Decimals

Please refer to this FAQ Does perl have a round function? What about ceil() and floor()? Trig functions?