#259 closed defect (fixed)
Review IMT_Info's use of NumberFormat...necessary?
Reported by: | Kevin Milner | Owned by: | Peter Powers |
---|---|---|---|
Priority: | major | Milestone: | OpenSHA 1.2 |
Component: | sha | Version: | |
Keywords: | Cc: |
Description
Is this code necessary? It was causing number format exceptions when run in different locales. I've implemented a fix (in []), but it should probably just be removed unless there's a specific reason:
double xVal =Double.parseDouble(format.format(Math.exp(Math.log(MIN_SA)+i*discretization_sa)));
Where format was defined as:
DecimalFormat format = new DecimalFormat("0.00000##");"
Note: See
TracTickets for help on using
tickets.
That's just silly.
I changed each line using format to (preserving 5 decimal precision) e.g.:
double xVal = MathUtils?.round(Math.exp(Math.log(MIN_SA)+i*discretization_sa), 5);
and removed formatter references.