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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Rounding Up currency value

Status
Not open for further replies.

Jayson

Programmer
Jan 31, 2001
75
0
0
US
I need some help in rounding up a decimal currency value:

If decimal value falls in between 0.01 -> 0.49, it should round off to 0.5, if it falls in between 0.51 -> 0.99, round off to 1.

Example: $500.19 should become $500.5
$500.5 should stay as $500.5
$500.67 should become $501.0
 
This thread has a custom function to stop the 'banker's rounding' like you're seeing:

thread703-609679
 
Thanks foolio12!

Actually i found the answer to my question, see
thread705-705209 its exactly what i needed! but instead of 0.25 interval, mine increments by 0.50.

Good luck!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top