OpenWGA 7.7 - TMLScript reference
WGAMethod :
format(object, formatPattern [, language])
On object | WGA |
Usage |
Creates a formatted date string from a Date object or a formatted number string from a Number object |
Description |
Use the same syntax for format patterns as known from WebTML attribute format. For backward compatibility there still is a global function "format()" available whose use is discouraged since OpenWGA 5.3. |
Parameters |
object (String): Date or Number object formatPattern (String): Format pattern determining the output string format language (String, optional): |
Return value |
String representing the Date/Number in the specified format (String) |
Allowed in script types |
|
Examples |
Example using a Date: return WGA.format(CREATED, "dd.MM.yyyy") // Returning a string like "24.12.2005" Example using a number: return WGA.format(1.2, "#,##0.000") // Returning a string like "1.200" |