You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currency package helps you do currency computations accurately, by avoiding *_peddling_*.
15
-
The `Currency` struct holds all the data required to define a currency.
14
+
Currency package helps you do currency computations accurately. `Currency` struct holds all the data required to define a currency.
16
15
17
16
```
18
17
type Currency struct {
@@ -29,6 +28,10 @@ type Currency struct {
29
28
// FUShare represents the no.of fractional/sub units that make up 1 main unit. e.g. ₹1 = 100 paise
30
29
// Number of fractional units that make up 1 unit of the main value
31
30
FUShare uint
31
+
// PrefixSymbol if true will prefix the symbol when stringified
32
+
PrefixSymbol bool
33
+
// SuffixSymbol if true will suffix the symbol when stringified
34
+
SuffixSymbol bool
32
35
}
33
36
```
34
37
@@ -81,7 +84,7 @@ e.g. ₹1/- (INR 1) is to be divided by 3. There are 2 options of dividing this
81
84
82
85
### Multiple currency representations
83
86
84
-
1.`c1.String(prefixSymbol bool)`, returns a string representation of the currency value. Returns string prefixed by its respective symbol if `prefixSymbol` is true
87
+
1.`c1.String()`, returns a string representation of the currency value
85
88
2.`c1.Float64()`, returns a float64 representation of the currency value
0 commit comments