Re: Removing comma's on outputted integers
Daniel Dekany <[email protected]>
| Newsgroups | gmane.comp.web.freemarker.user |
|---|---|
| Message-ID | <[email protected]> |
Tuesday, January 12, 2010, 7:51:20 PM, Jordan Mendler wrote: > JR, > > How can I set this globally, so that all integer output assumes > computer formatting by default? I tried <#setting > locale="computer">, but it did not work. It's not the question of the locale, but of the number_format. Anyway, that doesn't have "computer" either (sorry...); to prevent grouping use the proper number_format. If you are concerned about computer-audience non-integers too, you may also want to set the locale so that it uses "." as the decimal point (like to "en"). As of setting these globally, the default value of all settings can be set globally were you configure FreeMarker. For more info (and some copy-pasting) see: http://freemarker.org/docs/app_faq.html#faq_number_grouping http://freemarker.org/docs/app_faq.html#faq_number_decimal_point Note that depending on what framework you are using, the specifying of the setting values may not be done in Java as in the FAQ examples, but in a .properties file, or in a Spring "beans" XML, etc. > Thanks so much, > Jordan > > > On Tue, Jan 12, 2010 at 3:15 AM, Jonathan Revusky <[email protected]> wrote: > ${myNumber?c} > > The ?c built-in means that you are outputting for the "computer" > locale. Otherwise, it tries to display the number correctly given the > default locale conventions. > > JR > > > On Tue, Jan 12, 2010 at 11:26 AM, Jordan Mendler <[email protected]> wrote: >> Hi all, >> >> I am new to Freemarker, and can't figure out how to display integers without >> comma groupings. For instance, I want to display 25000 but instead >> freemarker displays 25,000. >> >> I am seeing lots of things online, such as setting number_format, using the >> c function, locales, and other options, but none of them seem to work. I >> think I somehow need set setGroupingUsed(false) in the NumberFormat within >> the Freemarker Configuration object, but can't quite figure out how. >> setNumberFormat() takes a String so seems to be difference. >> >> Can someone please point me in the right direction here? >> >> I am using Freemarker standalone for XML processing, in a fairly plain way, >> with construction like this: >> Configuration fmConfig = new Configuration(); >> fmConfig.setDirectoryForTemplateLoading(new File( directory )); >> fmConfig.setObjectWrapper(new DefaultObjectWrapper()); >> >> >> Thanks so much, >> Jordan >> >> ------------------------------------------------------------------------------ >> This SF.Net email is sponsored by the Verizon Developer Community >> Take advantage of Verizon's best-in-class app development support >> A streamlined, 14 day to market process makes app distribution fast and easy >> Join now and get one step closer to millions of Verizon customers >> http://p.sf.net/sfu/verizon-dev2dev >> _______________________________________________ >> FreeMarker-user mailing list >> [email protected] >> https://lists.sourceforge.net/lists/listinfo/freemarker-user >> >> > > ------------------------------------------------------------------------------ > This SF.Net email is sponsored by the Verizon Developer Community > Take advantage of Verizon's best-in-class app development support > A streamlined, 14 day to market process makes app distribution fast and easy > Join now and get one step closer to millions of Verizon customers > http://p.sf.net/sfu/verizon-dev2dev > _______________________________________________ > FreeMarker-user mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/freemarker-user -- Best regards, Daniel Dekany ------------------------------------------------------------------------------ This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev