Return-Path: X-Original-To: apmail-freemarker-notifications-archive@minotaur.apache.org Delivered-To: apmail-freemarker-notifications-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 437AE181E2 for ; Wed, 30 Dec 2015 18:12:01 +0000 (UTC) Received: (qmail 31608 invoked by uid 500); 30 Dec 2015 18:12:01 -0000 Delivered-To: apmail-freemarker-notifications-archive@freemarker.apache.org Received: (qmail 31587 invoked by uid 500); 30 Dec 2015 18:12:01 -0000 Mailing-List: contact notifications-help@freemarker.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@freemarker.incubator.apache.org Delivered-To: mailing list notifications@freemarker.incubator.apache.org Received: (qmail 31475 invoked by uid 99); 30 Dec 2015 18:12:01 -0000 Received: from Unknown (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 30 Dec 2015 18:12:01 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id C0E99C0EAA for ; Wed, 30 Dec 2015 18:12:00 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.227 X-Spam-Level: * X-Spam-Status: No, score=1.227 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, LOTS_OF_MONEY=0.001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.554] autolearn=disabled Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id ObTNYqwoPjo9 for ; Wed, 30 Dec 2015 18:11:58 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with SMTP id 6CAC42304F for ; Wed, 30 Dec 2015 18:11:57 +0000 (UTC) Received: (qmail 30972 invoked by uid 99); 30 Dec 2015 18:11:57 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 30 Dec 2015 18:11:57 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 463DEE020A; Wed, 30 Dec 2015 18:11:57 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: ddekany@apache.org To: notifications@freemarker.incubator.apache.org Date: Wed, 30 Dec 2015 18:12:13 -0000 Message-Id: In-Reply-To: <339cef967c1c4632a2fb638d2118b400@git.apache.org> References: <339cef967c1c4632a2fb638d2118b400@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [18/35] incubator-freemarker git commit: (Manual adjustments in formatting related parts) (Manual adjustments in formatting related parts) Project: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/commit/ea391539 Tree: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/tree/ea391539 Diff: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/diff/ea391539 Branch: refs/heads/master Commit: ea39153956c0860927ef516e3eeed232d5dc89c1 Parents: f112ed6 Author: ddekany Authored: Sat Dec 26 19:59:19 2015 +0100 Committer: ddekany Committed: Sat Dec 26 19:59:19 2015 +0100 ---------------------------------------------------------------------- src/manual/en_US/book.xml | 64 ++++++++++++++++++++++++------------------ 1 file changed, 36 insertions(+), 28 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/ea391539/src/manual/en_US/book.xml ---------------------------------------------------------------------- diff --git a/src/manual/en_US/book.xml b/src/manual/en_US/book.xml index b68ff4c..51fae1f 100644 --- a/src/manual/en_US/book.xml +++ b/src/manual/en_US/book.xml @@ -15003,21 +15003,22 @@ rif: foo XYr baar number - Converts a number to a string. It uses the default format that - the programmer has specified via the + Converts a number to a string. In its simplest form + (expression?string) it + uses the default format that the programmer has specified via the number_format and the locale - settings. You can also specify a number format explicitly with this - built-in, as it will be shown later. + configuration settings. You can also specify a number format + explicitly with this built-in, as it will be shown later. There are four predefined number formats: computer, currency, number, and percent. The exact meaning of these is locale (nationality) specific, and is controlled - by the Java platform installation, rather than by FreeMarker, except - for computer, which uses the same formatting as - the c - built-in. There can also be programmer-defined formats, whose - name starts with @ (programmers computer, which uses the same formatting as the c built-in. + There can also be programmer-defined formats, whose name starts with + @ (programmers see more here...). You can use these predefined formats like this: @@ -15039,8 +15040,9 @@ $42.00 42 The output of first three expressions is identical because the - first two expressions use the default format, which is "number" - here. You can change this default using a setting: + first two expressions use the default format, which is + number here. You can change this default using a + setting: <#setting number_format="currency"> <#assign x=42> @@ -15058,20 +15060,23 @@ $42.00 $42.00 4,200% - since the default number format was set to "currency". + since the default number format was set to + currency. You can also refer to named custom formats that were defined when configuring FreeMarker (programmers see more here), like: - ${x?strong.@price} -${x?strong.@weight} + ${x?string.@price} +${x?string.@weight} where the custom format names were price and - weight. Note that hence the templates can just refer - to the application-domain meaning, and the exact format can be - specified outside the templates, on a single central place. + weight. This way the templates can just refer to the + application-domain meaning, and the exact format can be specified + outside the templates, on a single central place. (Programmers can + read about defining such + named formats here...) Beside named formats, you can specify number format patterns directly, using the Programmer-defined formats (starts with @ + letter): --> -${lastUpdated?string.@lastMod} +<#-- Programmer-defined named format (@ + name): --> +${lastUpdated?string.@fileDate} -<#-- More advanced ISO 8601-related formats: --> +<#-- Advanced ISO 8601 and XSD formatting: --> ${lastUpdated?string.iso_m_u} ${lastUpdated?string.xs_ms_nz} @@ -15870,9 +15875,12 @@ Tue, Apr 8, '03 2003 Note that with custom formats like in - lastUpdated?string.@lastMod above, templates can + lastUpdated?string.@fileDate above, templates can just refer to the application-domain meaning, and the exact format - can be specified outside the templates, on a central place. + can be specified outside the templates, on a central place. + (Programmers can read about defining such named formats + here...) Unfortunately, because of the limitations of the Java