Wiki source code of Money

Version 1.1 by Pierre Dubois on 2011/10/17 09:25

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 == Functions ==
32 === Add(param) ===
33 Adds an amount to this amount
34
35 return: The total of the two amounts
36 example:
37 {{code language="javascript"}}
38 var total = amount1.Add(amount2);
39 {{/code}}
40
41 === Substract(param) ===
42 Substract an amount to this amount
43
44 return: The result of the substraction
45 example:
46 {{code language="javascript"}}
47 var diff = amount1.Substract(amount2);
48 {{/code}}
49
50 === Multiply(param) ===
51 Multiply an amount by a number
52 * param a number (double)
53
54 return: The result
55 example:
56 {{code language="javascript"}}
57 var result = amount1.Multiply(taxrate);
58 {{/code}}
This wiki is licensed under a Creative Commons 2.0 license
XWiki Enterprise 9.11.5 - Documentation