DecimalNumber

Bug fix: the class no longer changes the parameter when calling the add and subtract methods.
January 21st, 2004, thanks to Jon Broude

Welcome to my DecimalNumber class's home page. I wrote it to be able to calculate and display decimal numbers when writing midlets for mobile phones. I needed something relatively simple and this class does everything I need, at least for now. It has been tested with JUnit. It may help you if the MIDP emulator throws exceptions like "bad method signature" or "ALERT: floats not available".

My Java authoring experience amounts to a week or so. There be dragons, as they used to say on old maps. I hope someone may still find this useful, and if you find any dragons or their smaller cousins bugs I would appreciate your feedback. You can also download DecimalNumber.class as compiled bytecode.

Alternatives

My class is very basic. If you need something more advanced than this you should look at MathFP or Henson's Float class.