Difference between revisions of "CURRENCY()"

From Lianjapedia
Jump to: navigation, search
m (1 revision)
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
==Purpose==
 
==Purpose==
 
Function to prefix numeric value with currency character
 
Function to prefix numeric value with currency character
 
  
 
==Syntax==
 
==Syntax==
CURRENCY(<expN>)
+
CURRENCY(<expN1> [, <expN2>])
 
+
  
 
==See Also==
 
==See Also==
 
[[SET CURRENCY]]
 
[[SET CURRENCY]]
 
  
 
==Description==
 
==Description==
The CURRENCY() function returns the specified <expN> as a character string prefixed with the current currency character which can be set with the command SET CURRENCY TO <expC>.  The default for SET CURRENCY is "$".
+
The CURRENCY() function returns the specified <expN1> as a character string prefixed with the current currency character which can be set with the command SET CURRENCY TO <expC>.  The default for SET CURRENCY is "$".  The optional <expN2> can be used to increase the number of decimal places.  By default, two decimal places are returned, but this can be increased up to four.  The <expN1> is rounded to the number of decimal places if required.  
  
 
Note for locale specific settings:
 
Note for locale specific settings:
Line 25: Line 22:
 
? currency(88.00)
 
? currency(88.00)
 
     $88.00
 
     $88.00
 +
? currency(123.4567)
 +
  $123.46
 +
? currency(123.4567,4)
 +
$123.4567
 
</code>
 
</code>
  
 
==Products==
 
Recital Server, Recital
 
 
[[Category:Documentation]]
 
[[Category:Documentation]]
 
[[Category:Functions]]
 
[[Category:Functions]]
[[Category:Numeric Data]]
 
 
[[Category:Numeric Data Functions]]
 
[[Category:Numeric Data Functions]]

Latest revision as of 06:14, 4 March 2013

Purpose

Function to prefix numeric value with currency character

Syntax

CURRENCY(<expN1> [, <expN2>])

See Also

SET CURRENCY

Description

The CURRENCY() function returns the specified <expN1> as a character string prefixed with the current currency character which can be set with the command SET CURRENCY TO <expC>. The default for SET CURRENCY is "$". The optional <expN2> can be used to increase the number of decimal places. By default, two decimal places are returned, but this can be increased up to four. The <expN1> is rounded to the number of decimal places if required.

Note for locale specific settings:

To change the separator character from a ',' use the SET SEPARATOR TO command.

To change the point character from a '.' use the SET POINT TO command.

Example

set currency to "$"
? currency(88.00)
    $88.00
? currency(123.4567)
   $123.46
? currency(123.4567,4)
 $123.4567