Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Perl
Perl Misc
Rounding up to 2 decimal places
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Gary Mayor, post: 4750091"] Hi, What a nightmare i've been trawling deja all morning for a simple method of rounding a number up to 2 decimal places. I've checked out the ceil function which only rounds numbers up to no decimal places which is no good. The printf function rounds numbers up and down. Let's take this number 0.3325 I need it to be, 0.34 How do i do that. Do I have to write a routine that checks if there is a third digit or what. The number is calculated for the UK VAT system at 17.5% i need the number rounded up to only 2 decimal places. Yes I have checked perlfaq4. Simple problem seems impossible answer. Any ideas Gary [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Perl
Perl Misc
Rounding up to 2 decimal places
Top