Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#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:


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##");"

Change History (3)

comment:1 Changed 13 years ago by Peter Powers

Resolution: fixed
Status: newclosed

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.

comment:2 Changed 13 years ago by Kevin Milner

works for me...thanks

comment:3 Changed 13 years ago by Peter Powers

fixed in [7777]

Note: See TracTickets for help on using tickets.