bmi_calculator 0.1.0 → 0.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 51e1c2c419ccefc3af5a5157816bea3a7358027e
4
- data.tar.gz: 60cc326a64b410ffa55925ad729e0ba4e936ef3a
3
+ metadata.gz: 322056f3e997367d4faa82c51fde6b7715c6830b
4
+ data.tar.gz: 6dfaad7305135113f19ab78f3dae6fc90c03cf42
5
5
  SHA512:
6
- metadata.gz: a1f58a1592ad61421882c3f136f0b974f43784f7cb409398eeb709ec0709fe8e0a74ee33035b7522625a468d518e4067d402c5e80e0c627646d4cf262791194e
7
- data.tar.gz: 708de182bd9aa5aef4da5ecc2c5d3f0a13844c3bb7582314fa2c7a39b1a1af6db477de24fc8311f7b7482ba41e544d918044fa30b4de48c9e143191dcdabd218
6
+ metadata.gz: d6169843a4233276673dda1c7f1f5c3aa4a7b19bb6588517cf3c2c3b0d1f251a207617082d0fee0711ed94f23f05263bb989de72bba46b13a2fbba8dfbbe2183
7
+ data.tar.gz: 3839c845d8471110a11d3201ed53ed7b52ee098a2b7576a59e5553d326fb7d37d45a55973ed6158b1a974c0cb5b124844d9af21e58a080ccb9f015de9517a110
data/README.md CHANGED
@@ -29,6 +29,9 @@ bmi = BmiCalculator.calc_m(1.7, 60)
29
29
  # calc cm, kg
30
30
  bmi = BmiCalculator.calc_cm(170, 60)
31
31
 
32
+ # calc cm, g
33
+ bmi = BmiCalculator.calc_cm_g(170, 60000)
34
+
32
35
  # calc feet, inch, pound
33
36
  bmi = BmiCalculator.calc_yp(5, 7, 130)
34
37
  ```
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
10
10
  spec.email = ["corporation.ore@gmail.com"]
11
11
 
12
12
  spec.summary = %q{Calculation BMI. height use m, cm, feet and inch.}
13
- spec.description = %q{Calculation BMI. height use m, cm, feet and inch. You can use very easy to use.}
13
+ spec.description = %q{Calculation BMI. height use m, cm, feet and inch. You can very easy to use.}
14
14
  spec.homepage = "https://github.com/h-shigemoto/bmi_calculator"
15
15
  spec.license = "MIT"
16
16
 
@@ -16,7 +16,7 @@ module BmiCalculator
16
16
  # calc bmi.
17
17
  # @param [integer] height(cm) height
18
18
  # @param [float] weight(kg) weight
19
- # @param [integer] round round numberfddfv
19
+ # @param [integer] round round number
20
20
  # @return [float] bmi
21
21
  def self.calc_cm(height, weight, round=1)
22
22
 
@@ -26,6 +26,20 @@ module BmiCalculator
26
26
  bmi.round(round)
27
27
  end
28
28
 
29
+ # calc bmi.
30
+ # @param [integer] height(cm) height
31
+ # @param [float] weight(g) weight
32
+ # @param [integer] round round number
33
+ # @return [float] bmi
34
+ def self.calc_cm_g(height, weight, round=1)
35
+
36
+ height_m = (height / 100.0).round(2)
37
+ weight_kg = (weight / 1000.0).round(1)
38
+
39
+ bmi = weight_kg / (height_m * height_m)
40
+ bmi.round(round)
41
+ end
42
+
29
43
  # calc bmi by yard-pound.
30
44
  # @param [integer] height_ft height(feet)
31
45
  # @param [integer] height_in height(inch)
@@ -1,3 +1,3 @@
1
1
  module BmiCalculator
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bmi_calculator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - h.shigemoto
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-08-06 00:00:00.000000000 Z
11
+ date: 2016-08-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -52,8 +52,8 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '3.0'
55
- description: Calculation BMI. height use m, cm, feet and inch. You can use very easy
56
- to use.
55
+ description: Calculation BMI. height use m, cm, feet and inch. You can very easy to
56
+ use.
57
57
  email:
58
58
  - corporation.ore@gmail.com
59
59
  executables: []