From f26203ef32e70127e44a084ceae2be8fafba1928 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut <peter_e@gmx.net> Date: Tue, 26 Feb 2008 15:32:30 +0000 Subject: [PATCH] Add information about format modifiers that apply to numeric formats. These were previously only documented in the context of date/time formats. --- doc/src/sgml/func.sgml | 41 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index 340efac6556..b362d8ac034 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -1,4 +1,4 @@ -<!-- $PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.419 2007/12/21 03:37:18 tgl Exp $ --> +<!-- $PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.420 2008/02/26 15:32:30 petere Exp $ --> <chapter id="functions"> <title>Functions and Operators</title> @@ -5320,6 +5320,45 @@ SELECT SUBSTRING('XY1234Z', 'Y*?([0-9]{1,3})'); </itemizedlist> </para> + <para> + Certain modifiers can be applied to any template pattern to alter its + behavior. For example, <literal>FM9999</literal> + is the <literal>9999</literal> pattern with the + <literal>FM</literal> modifier. + <xref linkend="functions-formatting-numericmod-table"> shows the + modifier patterns for numeric formatting. + </para> + + <table id="functions-formatting-numericmod-table"> + <title>Template Pattern Modifiers for Numeric Formatting</title> + <tgroup cols="3"> + <thead> + <row> + <entry>Modifier</entry> + <entry>Description</entry> + <entry>Example</entry> + </row> + </thead> + <tbody> + <row> + <entry><literal>FM</literal> prefix</entry> + <entry>fill mode (suppress padding blanks and zeroes)</entry> + <entry><literal>FM9999</literal></entry> + </row> + <row> + <entry><literal>TH</literal> suffix</entry> + <entry>uppercase ordinal number suffix</entry> + <entry><literal>999TH</literal></entry> + </row> + <row> + <entry><literal>th</literal> suffix</entry> + <entry>lowercase ordinal number suffix</entry> + <entry><literal>999th</literal></entry> + </row> + </tbody> + </tgroup> + </table> + <para> <xref linkend="functions-formatting-examples-table"> shows some examples of the use of the <function>to_char</function> function. -- GitLab