IntSys_CientNotation 0.1.0

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.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/cient_notation.rb +13 -0
  3. metadata +46 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 36299d9c6248c776eadd42c43af06972e2f69105
4
+ data.tar.gz: c77743b372b22b6f8da166085af621e21b2ca4d5
5
+ SHA512:
6
+ metadata.gz: ec3f3a0f46bd5f3ab39ee0560abf5c34d15484d54bfb245a011a7ef4fc5f3d1aa8ed0ea27483a097bc3aeae5953d5fa24f9be8d6df248c80e676cbb3dff30618
7
+ data.tar.gz: 31155c5ae557796f8d91a67967fa5e67a84afd147cad53315aab6e774c36765f5ad60ea20ab2de5c4fe16d2810941fd7598837e79d47fa42c45afd0b4028ce79
@@ -0,0 +1,13 @@
1
+ class NumberFormat
2
+ def format(number)
3
+ digits = number.to_s.size
4
+ case digits
5
+ when 1..3
6
+ "#{number}"
7
+ when 4..6
8
+ "#{(number/1000.0).round(1)}K"
9
+ when 7..9
10
+ "#{(number/1000000.0).round(1)}M"
11
+ end
12
+ end
13
+ end
metadata ADDED
@@ -0,0 +1,46 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: IntSys_CientNotation
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Leonardo Pérez
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-10-08 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: A simple gem to format a number in cientific notation according to International
14
+ System
15
+ email: leono286@soysolito.com
16
+ executables: []
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - lib/cient_notation.rb
21
+ homepage: https://github.com/leono286/cient_notation
22
+ licenses:
23
+ - MIT
24
+ metadata: {}
25
+ post_install_message:
26
+ rdoc_options: []
27
+ require_paths:
28
+ - lib
29
+ required_ruby_version: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ required_rubygems_version: !ruby/object:Gem::Requirement
35
+ requirements:
36
+ - - ">="
37
+ - !ruby/object:Gem::Version
38
+ version: '0'
39
+ requirements: []
40
+ rubyforge_project:
41
+ rubygems_version: 2.5.1
42
+ signing_key:
43
+ specification_version: 4
44
+ summary: A simple gem to format a number in cientific notation according to International
45
+ System
46
+ test_files: []