Repository navigation
Shortcode Parameters
David Artiss edited this page Nov 12, 2017
·
1 revision
The shortcode of '[convert]' has the following parameters that you may specify...
- number - The number that you wish to convert from one currency to another. This is required
- from - The currency code that you wish to convert from (see the admin options for a list of valid codes). If you do not specify this value then the default from the options screen will be used
- to - The currency code that you wish to convert to (see the admin options for a list of valid codes). If you do not specify this value then the default from the options screen will be used.
- dp - How many decimal places the output should be. This should be numeric or the word "match". The latter is the default and will mean that the output will match the number of decimal places that the number was.
- template - See the later section, "Using Templates", for further information
Example of use are...
[convert number=49.99 from="gbp" to="usd"]
This would convert 49.99 from UK pounds to US dollars and output the result to 2 decimal places.
[convert number=50 from="usd" to="gbp"]
This would convert 50 from US dollars to UK pounds and output the result without any decimal places.
If the conversion can't be done then an appropriate error message will be output instead. If you wish to suppress these messages then you need to use a template (see the later section on this) - in this case no output will be generated in the case of an error.