istox 0.1.157.11.2 → 0.1.157.11.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 54ed9bcff5c0cf4fac36db3d932688509800043f0841bb38f60495c923039912
4
- data.tar.gz: 4a7375a044969a37152bb06e20725dd82ad841e523913a08dc23822c27a64ba2
3
+ metadata.gz: daad77968adcfb93af925ac10dcce8e2c5aea6320ff15fc965de447a159dbe43
4
+ data.tar.gz: bbad1acc6bf763ccde104f6ea426cf4d094212de19e0da03f3d295ebb827fa8e
5
5
  SHA512:
6
- metadata.gz: 9c2b012d97b4d5e29ea5516acb70645cf69a998d761cb11dcb15f9f93dcc751ced67f23bf9d9ac8064ee544559488023d83e4f534c3de9c2cc4612939fd4806d
7
- data.tar.gz: c87a1c4b5a5ed11f7cf1fe3fda3871ff69a09286b79b2523fade5bed4be87ef8d3c332eb2c87cbffad97f2caef727dda94260dc68e6654b2135651f6b020726e
6
+ metadata.gz: cb7a8b451b28f166df88585182226e17056d433a31bf26a253e3551a6794d220c4c035a3a2f92442fbc1c320b75d39b058beb23f8241a7e71594a95809ccc405
7
+ data.tar.gz: 8efd5aad68d20d572bf850ba17d25ac4f1faf8f8ce534e2720c72728e5cfa945d873cd3770ef1235e6997836500dc63248ad9bc91373827a89216aad3191e41c
data/.gitignore CHANGED
File without changes
data/.rubocop.yml CHANGED
File without changes
data/.solargraph.yml CHANGED
File without changes
data/CODE_OF_CONDUCT.md CHANGED
File without changes
data/Gemfile CHANGED
File without changes
data/README.md CHANGED
File without changes
data/Rakefile CHANGED
File without changes
File without changes
@@ -58,5 +58,11 @@ module Istox
58
58
  obj
59
59
  end
60
60
  end
61
+
62
+ def self.get_currency_decimal(currency)
63
+ return 0 if currency&.downcase == 'jpy'
64
+
65
+ 2
66
+ end
61
67
  end
62
68
  end
File without changes
@@ -17,8 +17,18 @@ module Istox
17
17
  end
18
18
 
19
19
  # format a money, eg. 20000.134 > SGD 20,000.14, position can be :front or :behind, abs_num: whether to absolute the number
20
- def money(input, round_mode: :half_up, precision: 2, currency:, position: :front, abs_num: false)
21
- result = number(input, round_mode: round_mode, precision: precision, abs_num: abs_num)
20
+ def money(input, round_mode: :half_up, precision: nil, currency:, position: :front, abs_num: false, hide_currency: false)
21
+ # precision = ::Istox::CommonHelper.get_currency_decimal(currency, precision)
22
+
23
+ decimal_place = if precision.present?
24
+ precision
25
+ else
26
+ ::Istox::CommonHelper.get_currency_decimal(currency)
27
+ end
28
+
29
+ result = number(input, round_mode: round_mode, precision: decimal_place, abs_num: abs_num)
30
+
31
+ return result if hide_currency
22
32
 
23
33
  return currency + ' ' + result if position == :front
24
34
 
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
data/lib/istox/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Istox
2
- VERSION = '0.1.157.11.2'.freeze
2
+ VERSION = '0.1.157.11.7'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: istox
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.157.11.2
4
+ version: 0.1.157.11.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Siong Leng
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-01-26 00:00:00.000000000 Z
11
+ date: 2021-02-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: amazing_print
@@ -546,7 +546,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
546
546
  - !ruby/object:Gem::Version
547
547
  version: '0'
548
548
  requirements: []
549
- rubygems_version: 3.0.6
549
+ rubygems_version: 3.2.11
550
550
  signing_key:
551
551
  specification_version: 4
552
552
  summary: istox backend shared gem