pretty_floats 2.1.1 → 2.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/pretty_floats.rb +4 -0
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c55d7ddbb44134dd3c5b5d1798f27cf6f2f7244aad99cde2713a09d60298661b
4
- data.tar.gz: 2961c06fe81b65aa3ac9ec132eceb0de2173e2ed226697601bf7c0d9c0ea01f0
3
+ metadata.gz: b9a43cad371e15ef7084c8436cc400bb0b98e77df684f1b70a482e6401d87ed8
4
+ data.tar.gz: fb68807e279f755e7c4a8e21a3b3b2457f9e11061078a4b6a3ab72dc54b7b05b
5
5
  SHA512:
6
- metadata.gz: 4f9add340af35497dd115f8f0d6db78a1b44d93b2ed49d133c76ddda4c404771528a4d5203427a30b26658e6e39244a3c38e3685c360cf81c57fb1865a857961
7
- data.tar.gz: 648e44584e753f965bc6a87108c4acd524e0fe97cc3b4c7605a10f5dce7fbd69176765a7674f9abf53fa628e660b566a29fe4be760ffc1412a1200ab8fae8bed
6
+ metadata.gz: e98f425a05ed825abdd82ae5759969a47d9e678f0dd2f03b2b42a3b9f4c9ec741a8c2688ed062206145aa8cb69939c05986633265e90df7e918316bc8a85dda7
7
+ data.tar.gz: f64339807747c089160eadd3688dd21716eae688af3b0b539a73a0c3c1cd3c111dbb3b8f9caf3b93ce931f3b6720d583361702a6f8ac7177399bb27c1f7b0794
data/lib/pretty_floats.rb CHANGED
@@ -1,5 +1,9 @@
1
1
  class Float
2
2
  # changes numbers like 1234567 to "1,234,567"
3
+ # or:
4
+ #
5
+ # > -13321.23.prettify(num_places: 2)
6
+ # => "-13,321.77"
3
7
  def prettify(place_sep: ',', radix_sep: '.', num_places: -1)
4
8
  sign = self < 0 ? '-' : ''
5
9
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pretty_floats
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.1
4
+ version: 2.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeff Lunt
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-09-16 00:00:00.000000000 Z
11
+ date: 2023-09-17 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: a small utility to format floating point numbers for easier reading
14
14
  email: jefflunt@gmail.com