excel_to_code 0.1.22 → 0.1.23

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
  SHA1:
3
- metadata.gz: f1b2c421597403690e3738e1f56d63952aee2408
4
- data.tar.gz: 3fc17ec74fc2d294220e7cf3b319d8cafe67babf
3
+ metadata.gz: 80514163db20835472c1af4fcd9d58c5705037cf
4
+ data.tar.gz: 50da754f9c831eb99917d0f460a6876db0c9c3b5
5
5
  SHA512:
6
- metadata.gz: f52431b3047ba767b58f22cd02e5cffc90e4a1eadd207d8dcafe3b00877ea3fc7cfe557f1fc6d1785372bcf7c323fa406af3c01e049a7e891059cb7b60a3cfd4
7
- data.tar.gz: 957cf0e0ff469aeba06b08c97013b093f51d5ed8e5a2308e079293a0be2b57c3047f16168418fe5e532911733be2b6f115fd4e4137efd39d70bdd52a08ba716f
6
+ metadata.gz: d4c99e4ffbf3319fe1a95390ebd0ce149d543cd60a2c207955a925083bb9e68ae518a84d2bcbea429b67d7f63a87923dc18dde956bda74cda3503c1750987148
7
+ data.tar.gz: 1c2929b8d1474a63e085013545fd6a0250bc5863b1294bed9c61c8fa9a984176d92e298fdddf722b8e79c67423c3040ec8ef9e64c6e011277bba2aa251d89153
@@ -47,6 +47,7 @@ class MapFormulaeToRuby < MapValuesToRuby
47
47
  'POWER' => 'power',
48
48
  'PV' => 'pv',
49
49
  'RANK' => 'rank',
50
+ 'RIGHT' => 'right',
50
51
  'ROUND' => 'round',
51
52
  'ROUNDDOWN' => 'rounddown',
52
53
  'ROUNDUP' => 'roundup',
@@ -60,6 +60,7 @@ require_relative 'excel_functions/cosh'
60
60
  require_relative 'excel_functions/string_join'
61
61
  require_relative 'excel_functions/find'
62
62
  require_relative 'excel_functions/left'
63
+ require_relative 'excel_functions/right'
63
64
 
64
65
  # Rounding functions
65
66
  require_relative 'excel_functions/round'
@@ -0,0 +1,13 @@
1
+ module ExcelFunctions
2
+
3
+ def right(string,characters = 1)
4
+ return string if string.is_a?(Symbol)
5
+ return characters if characters.is_a?(Symbol)
6
+ return nil if string == nil || characters == nil
7
+ string = "TRUE" if string == true
8
+ string = "FALSE" if string == false
9
+ string = string.to_s
10
+ string.slice(string.length-characters,characters)
11
+ end
12
+
13
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: excel_to_code
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.22
4
+ version: 0.1.23
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas Counsell, Green on Black Ltd
@@ -160,6 +160,7 @@ files:
160
160
  - src/excel/excel_functions/power.rb
161
161
  - src/excel/excel_functions/pv.rb
162
162
  - src/excel/excel_functions/rank.rb
163
+ - src/excel/excel_functions/right.rb
163
164
  - src/excel/excel_functions/round.rb
164
165
  - src/excel/excel_functions/rounddown.rb
165
166
  - src/excel/excel_functions/roundup.rb