r2 - 25 Jan 2006 - 03:21:37 - TanDunlinYou are here: TWiki >  Main Web  >  ElixirReport > ElixirReportCookbook > JavaScriptAPIReference

JavaScript API Reference

Standard Javascript utilities can be easily referenced. Includes Formatting and Date Funtions.

Date

function offsetYears(origDate, numYears)

Code Snippet
offsetYears(new java.util.Date(), 4)

return system date (4 years ahead)
DateFunctions


Number

String formatNumber(Number n, int decimalPlaces)

Code Snippet
Format.formatNumber(345886,5)

return 345,886.00000


String formatNumber(Number n, String pattern)

Code Snippet
Format.formatNumber(450000,"#0,K")

return 450K

*Note that pattern only allows '#,K' or '#0,K'


Currency

String formatCurrency(Number n, String locale)

Code Snippet
Format.formatCurrency(12364,java.util.Locale("de","DE"))

return 12.364,00€

More information on JavaScript API is available at Chapter 7. Elixir Report JavaScript Reference of User Manual

-- TanDunlin - 12 Jan 2006

Edit | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r2 < r1 | More topic actions
 
Powered by TWiki
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback