istox 0.1.155 → 0.1.155.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/istox/helpers/formatter.rb +2 -2
- data/lib/istox/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 77900ec4b0b82e5b1b7a1128c68ca5f8274c88336102c859ec10d29a8bde749e
|
4
|
+
data.tar.gz: 338432eb0c47851f7bdcaf066750b861d220e787f61769d56b8c816c4ce7004c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 654a77d8521ffadd0f41a6d4c2c8186628a983c85472280cef98a03eb45b4d8373058b761bab544db6f4464abe4546976f37e9f5495e4025344b4b14012da739
|
7
|
+
data.tar.gz: 9c63efedc40d7d5e4bf04611234f8b97f517909fae3aad6d07af42cd4e1d22ffca8d286a3a924638009d1a01458d1a50f63774ffa4af6190eaad910630935afa
|
data/Gemfile.lock
CHANGED
@@ -4,7 +4,7 @@ module Istox
|
|
4
4
|
include ActionView::Helpers::NumberHelper
|
5
5
|
|
6
6
|
# format a number, eg. 20000.134 > 20,000.14
|
7
|
-
def number(input, round_mode: :
|
7
|
+
def number(input, round_mode: :half_up, precision: 2)
|
8
8
|
BigDecimal.mode(BigDecimal::ROUND_MODE, round_mode)
|
9
9
|
|
10
10
|
input = 0 if input.blank?
|
@@ -15,7 +15,7 @@ module Istox
|
|
15
15
|
end
|
16
16
|
|
17
17
|
# format a money, eg. 20000.134 > SGD 20,000.14, position can be :front or :behind
|
18
|
-
def money(input, round_mode: :
|
18
|
+
def money(input, round_mode: :half_up, precision: 2, currency:, position: :front)
|
19
19
|
result = number(input, round_mode: round_mode, precision: precision)
|
20
20
|
|
21
21
|
return currency + ' ' + result if position == :front
|
data/lib/istox/version.rb
CHANGED