The @format(...)@ syntax displays a number field's value as currency throughout SmartSimple, using the three-letter ISO 4217 currency code to apply the correct symbol and decimal formatting.
Display a Field Value as Currency
A number field's value can be displayed as currency in another custom field, such as a Web Page View field, using the following syntax. FIELDNAME is the name of the field being referenced, and CURRENCYCODE is the three-letter ISO 4217 currency code.
@format(FIELDNAME,currency,CURRENCYCODE)@
The table below shows a field named SampleField containing the value 300, displayed using different currency codes.
| Syntax | Display |
|---|---|
| @format(SampleField,currency,USD)@ | $300.00 |
| @format(SampleField,currency,EUR)@ | €300.00 |
| @format(SampleField,currency,JPY)@ | ¥300 |
| @format(SampleField,currency,ZAR)@ | R 300.00 |
| @format(SampleField,currency,INR)@ | ₹300.00 |
By default, currency formatting displays only when a record is in view mode. Currency formatting applies in edit mode only when Show Currency Format in Edit Mode is selected in the custom field settings.
Example
This example uses the currency function inside an sslogic conditional to display a minimum request amount only when the type is Special.
<!--@sslogic("@type@"="Special")-->(minimum @format(Minimum Request Amount,currency,FRCA)@ CAD)<!--@end-->XML Data Node Values
For an XML data node value, the currency syntax is placed before the node.nodevalue reference rather than wrapped around a field name.
For example, this node reference displays the raw value:
@xml.SampleField.staff.subtotal.y1-amount.nodevalue@
Adding the currency function to that same node displays the value as currency:
@xml.SampleField.staff.subtotal.currency_eur(y1-amount.nodevalue)@
A field named SampleField containing the value 300 displays as €300.00 using this syntax.