79696906

Date: 2025-07-10 10:39:13
Score: 0.5
Natty:
Report link

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.

Reasons:
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: Kuba D