xls_function 0.1.0 → 0.1.2
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.
- checksums.yaml +4 -4
- data/lib/xls_function/evaluators/functions/abs.rb +15 -0
- data/lib/xls_function/evaluators/functions/sign.rb +21 -0
- data/lib/xls_function/i18n.rb +1 -1
- 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: 2cb7d73e2dd1bb1c3c52f2281041b90a138757cb2c95de1fe19a8c8081a2c25e
|
4
|
+
data.tar.gz: 0eea9207be1c050b0885e9368f69a0db3ece73631dd117b6eb039e52764d39f5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1d5b1a4ceaff20676d93c6f6aa8ec5396f570b2809e9edbca5325d11e471b8337c6a102d3db9f5a446f7ddf15961a980445ad5315047549816739649b330020d
|
7
|
+
data.tar.gz: 28d06f5116060f72ca79b751800cbe8ee102eab6e8757c7d7f112049798f4a2b4ab2cbe1637031192a4e542953d523de7af51f6b852fca185403ac10ff05802e
|
@@ -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
|
data/lib/xls_function/i18n.rb
CHANGED
@@ -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.2
|
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-22 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
|