Re: Parsing of numeric values

wkbutler <[email protected]>
Newsgroups gmane.comp.web.freemarker.user
Message-ID <[email protected]>

Daniel Dekany wrote:
> 
> Tuesday, September 15, 2009, 3:46:17 PM, wkbutler wrote:
> I don't know... it's not enough concrete for me to form an opinion.
> The part that is a bit suspicious for me, that if the numerical output
> generated by the 1st order macros meant to be treated as numbers by
> the 2nd order macros, then why are they in human-audience format? I
> mean, FM can output in computer-audience numerical format as well.
> 

Good question - consider the case of subtotals and grand totals. Grand
totals operate on subtotals, subtotals operate on 'raw' data. Both are
products for the user.  You allude to another possible solution though,
which is to store both formats; I would rather avoid that, but it may be the
easiest approach.


Daniel Dekany wrote:
> 
>> Do I need to revert my dataset to a Map<String, Object>, or is there
>> another
>> way to inject custom utilities?
> 
> There is a way (as far as using a global variable instead of
> data-model variable is fine for you). Use something like this instead
> of the myTemplate.process(root, out) call:
> 
>   Environment env = myTemplate.createProcessingEnvironment(root, out);
>   env.setGlobalVariable("util",
>       env.getObjectWrapper().wrap(new DataUtil()));
>   env.process();
> 

Perfect - I will try that. Thank you -


-- 
View this message in context: http://www.nabble.com/Parsing-of-numeric-values-tp25446898p25462380.html
Sent from the freemarker-user mailing list archive at Nabble.com.


------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.