Im having trouble with some float/decimal/double format issue.
I have a class called MeasureFact with a Float property, called actual.
When I enter a value in a textbox on a form, it gets stored into actual property in MeasureFact.
If I enter 123456.78, it stores correctly as 123456.78
But if I enter 12345678.91, it stores as 1.2345679E7
If I change the actual property in the MeasureFact class to a BigDecimal, it works no problem. But the thing is, Ive got so many lines of code where I have it set to Float. So its gonna be a pain to change it all over the place and then double check for bugs.
I was thinking I could just convert the Float actual to a BigDecimal before I store into the database, but it still shows up as 1.2345679E7. Is there a way to convert this value to the way I entered it on the form (12345678.91) ?
BigDecimal actual = BigDecimal.valueOf(measureFact.getActual().doubleValue());