Formatting Pagelet Output

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)

Pagelet Formatted


I recently had to create a few pagelets based on query output. One of the issues I have encountered was formatting of the output. For example, displaying currency fields and dates in the format that shows decimal points, comma separating significant digits and adding currency signs.


I read a few references including Chapter 4 in Jim Marion’s books, but still had a problem with using formats in XSLT. Recently I found the following reference in Portal PeopleBook – Formatting Date, Time, DateTime, Currency, and Number Elements.

Note. FORMAT, WIDTH, and PRECISION have the same format as the NumberToDisplayString() PeopleCode Function. CURRENCY_CODE can be one of the supported PeopleSoft currency codes, or if left blank, defaults to the user's currency code. CURRENCY_DECORATION can have the value of SYMBOL (currency symbol appears before the number), CODE (currency code appears after the number), or BOTH (the default).

In order to actually format your number correctly I suggest you review the reference PeopleBook Reference for NumberToDisplayString() function.
In my case I wanted to display a column from query output formatted as $999,999,999.00. This resulted in the following section in XSLT template of the pagelet for the column:

			<td align="right">
					<xsl:attribute name="TYPE">CURRENCY</xsl:attribute>
					<xsl:attribute name="FORMAT">$v11.2</xsl:attribute>
					<xsl:attribute name="CURRENCY_CODE">USD</xsl:attribute>
					<xsl:attribute name="CURRENCY_DECORATION">$</xsl:attribute>
					<xsl:value-of select="querydata[position()=6]/text"/>

Let me know if you have any questions or suggestions for this or my next posts.

  1. Hanh Minson |
  2. Hanh |
  3. Iouri "Yury" Chadour |
  4. Hanh |
  5. Iouri "Yury" Chadour |
  6. Hanh |
  7. Iouri "Yury" Chadour |

I really want to know what you think