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!

round to nearest quarter cent

Status
Not open for further replies.

slybitz

Technical User
Mar 25, 2005
113
US
Is there an easy way to get the last two decimal places to round to the nearest quarter cent if I have a given number that is 4 decimal places? So for example if I have the # 40.1234 it would round to 40.1225, or if I have the # 40.1255 it would round to 40.1250, or I have the # 40.1988 it would round to 40.2000.

Thanks for the help!
 
Multiply by 4
Round to 2 decimal places
divide by 4

round(40.1234 * 4,2) / 4

-George

"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
Just what I needed. Thanks for your help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top