Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Rounding decimal number to nearest 0.05

 
Pradeep bhatt
Ranch Hand
Posts: 8927
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to round decimal number to nearest 0.05. Let me know if the following examples are correct.

12.325 becomes 12.33 and gets rounded to 12.35.
12.315 becomes 12.32 -> 12.30
12.323 ->12.32->12.30
12.399->12.40
12.385->12.40
thanks
 
Pradeep bhatt
Ranch Hand
Posts: 8927
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anyone ?
 
Chetan Parekh
Ranch Hand
Posts: 3640
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rules for Rounding
 
Pradeep bhatt
Ranch Hand
Posts: 8927
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Chetan.
Actually the formula is quite simple

Round(A*20)/20.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic