11
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Notionで小数点を丸める

Last updated at Posted at 2020-11-26

金額の場合

割り算をして小数点が現れたとき、フォーマットをYenにすると自動的に小数点が四捨五入されます。

Screenshot 2020-11-26 11.24.11.png

割合の場合

一方、フォーマットをPercentにしたときは良きに計らってくれません。

Screenshot 2020-11-26 11.29.05.png

その場合は、round関数を用いて数字丸めをすればOK。とくに桁の指定はできないので、強制的に整数に丸めらます。

なのでこの場合は、小数点1桁まで%表記で欲しいとすると、一度1000をかけてそれをroundして、最後に1000で割りなおせばOK。

Screenshot 2020-11-26 11.29.25.png

11
2
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
11
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?