I have a SSJS function with the below lines of code that keeps returning the value of the field 'day' in scientific notation. I have tried using BigDecimal in addition to the below with no difference. All the other questions on SO and other blogs about scientific notation to decimal have examples for java so I have taken my best attempt at how those examples should be interpreted for SSJS.
Value stored in document accessed with exportDoc in code below using field name
Field Name: day
Data Type: Number
Data Length: 8 bytes
Seq Num: 1
Dup Item ID: 0
Field Flags: SUMMARY
-37.5
exportDoc.getItemValueDouble('day');
returned value: -3.75E1
var dform:java.text.DecimalFormat = new java.text.DecimalFormat("0.##");
var hrs:String = dform.format(exportDoc.getItemValueDouble('day'));
//using hrs:Double returns same value
returned value: -3.75E1
var hrs:String = dform.parse(@Text(exportDoc.getItemValueDouble('day')));
//using hrs:Double returns same value
returned value: -3.75E1
var hrs = Number(exportDoc.getItemValueDouble('day'));
returned value: -3.75E1
If I multiply the exportDoc.getItemValueDouble('day') by 10 I get -375, if I then divide by 10 I still get the -3.75E1, and if I use exportDoc.getItemValueInteger('day') I get -38.
This doesn't occur with whole negative numbers like -2, -108, etc. or positive numbers even if not a whole number.
Any help is greatly appreciated as this is causing issues when importing into our HRIS system.