0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

rex0220 計算式プラグイン 小数点3桁表示

Last updated at Posted at 2025-05-30

計算式プラグインで、数値を文字列項目に小数点3桁表示(1.000 等)でセットします。

概要

数値を小数点3桁表示したい場合に、文字列項目にセットして表示します。

  • 0 -> "0.000"
  • 1.1 -> "1.100"
  • 1000.1234 -> "1,000.123"
  • -1.1 -> "-1.100"
  • -1000.1234 -> "-1,000.123"

2025-05-30_15h48_59.png

計算式プラグイン設定

絶対値小数点3桁で切り捨てて、+0.0001 を加算後、文字形式にして最後の"1"を削除。
先頭に符号を追加。

2025-05-30_17h38_39.png

OPTION: 

// 小数点以下3桁 SINGLE_LINE_TEXT
IF(ISBLANK(数値), "",
  IF(数値 < 0, "-") & SLICE(FIXED(FLOOR(ABS(数値), 3) + 0.0001, 4), 0, -1)
)

※ LET 関数を利用した計算式例

OPTION: 

// 小数点以下3桁 SINGLE_LINE_TEXT
LET(val, 数値,
  IF(ISBLANK(val), "",
    IF(val < 0, "-") & SLICE(FIXED(FLOOR(ABS(val), 3) + 0.0001, 4), 0, -1)
  )
)
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?