Re: Change rounding mode
Attila Szegedi <[email protected]>
| Newsgroups | gmane.comp.web.freemarker.user |
|---|---|
| Message-ID | <[email protected]> |
Sure: freemarker.template.Configuration myConfig = ...; myConfig .getArithmeticEngine().setRoundingMode(BigDecimal.ROUND_HALF_UP); Attila. On Oct 15, 2008, at 9:23 AM, David Cuenca wrote: > Hello, > > I would like to know if there is an easy way to change freemarker's > default rounding mode. As the freemarker manual says: > > "Following the financial and statistics practice, the rounding goes > according the so called half-even rule, which means rounding towards > the > nearest ``neighbor'', unless both neighbors are equidistant, in which > case, it rounds towards the even neighbor..." > > But I would like to use HALF_UP. > > Does anybody know if it's configurable? > > Thanks! ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/