I have written a misc function that seems to work:
function getJdbcCurrency(result, col) {
let amntStr = result.getString(col);
if (result.wasNull())
{
return null;
}
if (amntStr.length == 0) {
return null;
}
return Number.parseFloat(amntStr);
}
Usage
row.push(getJdbcCurrency(results, col+1));
Parsing from string protects me from rounding issues, even if the number is still parsed as float.