Show last authors
1 Manipulates Currency amount information. The Currency type is returned when the property is of type 'Currency'
2
3 == Properties ==
4 === amount ===
5 Returns the amount value
6 Sets the amount
7
8 return: the number (double) value
9
10 === currency ===
11 Get the ISO currency symbol for that currency amount
12 Sets the currency. Note that this does NOT trigger a currency conversion.
13
14 return: The currency (ex EUR)
15
16 === date ===
17 Get the reference date (for currency conversions)
18 Set the reference date
19
20
21 === ref1 ===
22 Get the ref1 (converted value as reference currency 1 - by default EUR)
23 sets the ref1
24
25
26 === ref2 ===
27 Get the ref2
28 set the ref2
29
30
31
32
33 == Functions ==
34 === Add(param) ===
35 Adds an amount to this amount
36
37 return: The total of the two amounts
38 example:
39 {{code language="javascript"}}
40 var total = amount1.Add(amount2);
41 {{/code}}
42
43 === Substract(param) ===
44 Substract an amount to this amount
45
46 return: The result of the substraction
47 example:
48 {{code language="javascript"}}
49 var diff = amount1.Substract(amount2);
50 {{/code}}
51
52 === Multiply(param) ===
53 Multiply an amount by a number
54 * param a number (double)
55
56 return: The result
57 example:
58 {{code language="javascript"}}
59 var result = amount1.Multiply(taxrate);
60 {{/code}}
This wiki is licensed under a Creative Commons 2.0 license
XWiki Enterprise 9.11.5 - Documentation