paisa 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/README.md +1 -1
- data/lib/paisa.rb +6 -6
- data/lib/paisa/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eaa38290ac4afc7ee38d0ff32429018ab16dadd3
|
4
|
+
data.tar.gz: f7de502cf23909a04c0fd2f300c6accbf8ece1d2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fb1f3234a4f4aff3a95bbfbfd07625b629c52abc0a9d298d77c9418e9d2889c42f2e71be9b7d016e76b9b4c72634cfb6c16ced191d02c600a77aeaf3dcb5c637
|
7
|
+
data.tar.gz: 4e078ec975010ba8e03ebb82d942cd786861b06d13bd3b6fae884eac264f1d82aee7bf269ffbe307e3233f6aa6589a2fa52323198b71b23ba7ccbc78abeece32
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Paisa
|
1
|
+
# Paisa [![CircleCI](https://circleci.com/gh/sudhirj/paisa.svg?style=svg)](https://circleci.com/gh/sudhirj/paisa)
|
2
2
|
|
3
3
|
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/paisa`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
4
|
|
data/lib/paisa.rb
CHANGED
@@ -2,12 +2,12 @@ require 'paisa/version'
|
|
2
2
|
|
3
3
|
module Paisa
|
4
4
|
def self.format(paise)
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
5
|
+
little_endian = paise.to_s.reverse.chars
|
6
|
+
paise = little_endian.shift(2).reverse
|
7
|
+
hundreds = little_endian.shift(3).reverse
|
8
|
+
others = little_endian.each_slice(2).map(&:reverse).map(&:join)
|
9
|
+
rupees = [others.reverse, hundreds.join].flatten.compact.join(',').rjust(1, '0')
|
10
|
+
[rupees, paise.join.rjust(2, '0')].join('.')
|
11
11
|
end
|
12
12
|
|
13
13
|
def self.format_with_sym(paise)
|
data/lib/paisa/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: paisa
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sudhir Jonathan
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-10
|
11
|
+
date: 2016-12-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|