xls_function 0.1.1 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/xls_function/evaluators/functions/abs.rb +15 -0
- data/lib/xls_function/evaluators/functions/ifs.rb +2 -0
- data/lib/xls_function/evaluators/functions/sign.rb +21 -0
- data/lib/xls_function/locales/en.yml +2 -0
- data/lib/xls_function/locales/ja.yml +2 -0
- data/lib/xls_function/version.rb +1 -1
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 78fe15af8eb4b5dafce02e10b89a8328b1e025d035e1349982faceebfe40aa43
|
4
|
+
data.tar.gz: 52223d13a8aae89a0998e08b349299d63968c178192c549d7b03ff7a8347cf91
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1b05087ff9d7379fd8b4608f304162f8a1d69b623e5ced9b9e93f62b521c4b8fc5cfe91f526554e2c57416da7c626b5b76ecb90652a20b0d6af712fae4339f1a
|
7
|
+
data.tar.gz: 2a304ec0fcd97fc916833ea8be32f37fcd873e937638c68cc27527222c114842bb0a71b09bf2bbd3747b4c6c8a1cd92062ffec94089ce687007ac6a8dc72daf3
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module XlsFunction
|
2
|
+
module Evaluators
|
3
|
+
module Functions
|
4
|
+
class Sign < ::XlsFunction::Evaluators::FunctionEvaluator
|
5
|
+
function_as :sign
|
6
|
+
|
7
|
+
define_arg :number, type: :number
|
8
|
+
|
9
|
+
def eval
|
10
|
+
if number.positive?
|
11
|
+
1
|
12
|
+
elsif number.negative?
|
13
|
+
-1
|
14
|
+
else
|
15
|
+
0
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -1,6 +1,7 @@
|
|
1
1
|
en:
|
2
2
|
xls_function:
|
3
3
|
descriptions:
|
4
|
+
abs: ABS(number) Returns the absolute value of a number.
|
4
5
|
and: AND(logical1, [logical2], ...) returns TRUE if all its arguments evaluate to TRUE, and returns FALSE if one or more arguments evaluate to FALSE.
|
5
6
|
asc: ASC(text) For Double-byte character set (DBCS) languages, the function changes full-width (double-byte) characters to half-width (single-byte) characters.
|
6
7
|
char: CHAR(number) Returns the character specified by a number.
|
@@ -42,6 +43,7 @@ en:
|
|
42
43
|
roundup: ROUNDUP(number, num_digits) Rounds a number up, away from 0 (zero).
|
43
44
|
round: ROUND(number, num_digits) Rounds a number to a specified number of digits.
|
44
45
|
second: SECOND(serial_number) Returns the seconds of a time value. The second is given as an integer in the range 0 (zero) to 59.
|
46
|
+
sign: SIGN(number) Determines the sign of a number. Returns 1 if the number is positive, zero (0) if the number is 0, and -1 if the number is negative.
|
45
47
|
sqrt: SQRT(number) Returns a positive square root.
|
46
48
|
substitute: SUBSTITUTE(text, old_text, new_text, [instance_num]) Substitutes new_text for old_text in a text string.
|
47
49
|
text: TEXT(value, format_text) Lets you change the way a number appears by applying formatting to it with format codes.
|
@@ -1,6 +1,7 @@
|
|
1
1
|
ja:
|
2
2
|
xls_function:
|
3
3
|
descriptions:
|
4
|
+
abs: ABS(数値) 数値の絶対値を返します。
|
4
5
|
and: AND(条件1, [条件2], ...) すべての引数が TRUE と評価された場合は TRUE を返し、1 つ以上の引数が FALSE と評価された場合は FALSE を返します。
|
5
6
|
asc: ASC(文字列) 2 バイト文字セット (DBCS) 言語の場合、全角 (2 バイト) 文字を半角 (1 バイト) 文字に変更します。
|
6
7
|
char: CHAR(数値) 数値で指定された文字を返します。
|
@@ -42,6 +43,7 @@ ja:
|
|
42
43
|
roundup: ROUNDUP(数値, 桁数) 数値を指定された桁数に切り上げます。
|
43
44
|
round: ROUND(数値, 桁数) 数値を四捨五入して指定された桁数にします。
|
44
45
|
second: SECOND(シリアル値) 時刻の秒を返します。 戻り値は 0 (秒) ~ 59 (秒) の範囲の整数となります。
|
46
|
+
sign: SIGN(数値) 数値の正負を調べます。 戻り値は、数値が正の数のときは 1、0 のときは 0、負の数のときは -1 となります。
|
45
47
|
sqrt: SQRT(数値) 正の平方根を返します。
|
46
48
|
substitute: SUBSTITUTE(文字列, 検索文字列, 置換文字列, [置換対象]) 文字列に含まれる検索文字列を置換文字列へ置換します。
|
47
49
|
text: TEXT(value, format_text) 表示形式コードを使用して数値に書式設定を適用することで、数値の表示方法を変更することができます。
|
data/lib/xls_function/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xls_function
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nakakuki Shingo
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-12-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: i18n
|
@@ -100,6 +100,7 @@ files:
|
|
100
100
|
- lib/xls_function/evaluators/evaluable.rb
|
101
101
|
- lib/xls_function/evaluators/false_evaluator.rb
|
102
102
|
- lib/xls_function/evaluators/function_evaluator.rb
|
103
|
+
- lib/xls_function/evaluators/functions/abs.rb
|
103
104
|
- lib/xls_function/evaluators/functions/and.rb
|
104
105
|
- lib/xls_function/evaluators/functions/asc.rb
|
105
106
|
- lib/xls_function/evaluators/functions/char.rb
|
@@ -141,6 +142,7 @@ files:
|
|
141
142
|
- lib/xls_function/evaluators/functions/round_down.rb
|
142
143
|
- lib/xls_function/evaluators/functions/round_up.rb
|
143
144
|
- lib/xls_function/evaluators/functions/second.rb
|
145
|
+
- lib/xls_function/evaluators/functions/sign.rb
|
144
146
|
- lib/xls_function/evaluators/functions/sqrt.rb
|
145
147
|
- lib/xls_function/evaluators/functions/substitute.rb
|
146
148
|
- lib/xls_function/evaluators/functions/text.rb
|
@@ -214,7 +216,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
214
216
|
- !ruby/object:Gem::Version
|
215
217
|
version: '0'
|
216
218
|
requirements: []
|
217
|
-
rubygems_version: 3.
|
219
|
+
rubygems_version: 3.3.5
|
218
220
|
signing_key:
|
219
221
|
specification_version: 4
|
220
222
|
summary: Excel-like Functions Evaluator
|