So I'm working on a project that includes reading out a distance from a Ping))) sensor to a 16x2 lcd. I have the prototype done on my board and the code works brilliantly... a little too brilliantly. Using the double variable the lcd is displaying the inches rounded to the nearest 100th, however I want the lcd to display to the nearest quarter inch instead. For example; if ping.inches() returns 3.81 inches, I want it to display 4 inches instead by rounding up to the nearest .25.

Getting it to round to the nearest whole number is easy (replace "double" with "int"), but that's not accurate enough...

Any guidance on how this can be accomplished would be much appreciated!

So I'm working on a project that includes reading out a distance from a Ping))) sensor to a 16x2 lcd. I have the prototype done on my board and the code works brilliantly... a little too brilliantly. Using the double variable the lcd is displaying the inches rounded to the nearest 100th, however I want the lcd to display to the nearest quarter inch instead. For example; if ping.inches() returns 3.81 inches, I want it to display 4 inches instead by rounding up to the nearest .25.

Getting it to round to the nearest whole number is easy (replace "double" with "int"), but that's not accurate enough...

Any guidance on how this can be accomplished would be much appreciated!

I think this is what you are looking for: http://en.wikipedia.org/wiki/Rounding#Rounding_to_a_specified_increment

Start by getting a pre-algebra school book (even an old one), read the chapters and -do the exercises-. By the time you're done you'll understand a whole lot about math in -usable terms- and things like division ("the relational operator") will never seem the same. It might be all you need.