Sunday, April 06, 2008

Round me up Scottie...

Stumbled upon ugly code...

Financial application using double everywhere and using DecimalFormat for rounding. It boggles the wet corners of the mind.

Java DecimalFormat uses ROUND_HALF_EVEN and financial applications more often than not requires ROUND_HALF_UP or the way we are tought in grade school.

The coming week is gonna be a long week if we are to clean it up. And I had already communicated to use BigDecimal for amount since day 1, but nobody is listening. Not so shiny...

Am technically a code janitor nowadays.

1 comment:

jun of zerogravity said...

di pa rin ako maka-relate sa java-java na yan.

Have met a Sri Lankan Sun-certified java expert here who came for an NGO training, at nate-tempt na akong mag-try ng java kaya lang napapa-twitch mukha ko parati pag magsisimula na. Kaya naman am thinking of upgrading na lang my skill either with Ruby on Rails (for the moolah) or Python (so i can toy with google apps).

O siguro mag-start muna ako sa java for mobile phone.

whatever, kainggit ka, sana noon pa ako nagsimula sa java.