コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
4219 ビュー

Hallo,

I want to ask.. How to remove decimal if the value is zero. Example 123,456,789.00 <--- how to remove 00 ?

Thanks

アバター
破棄
最善の回答

I think in python you can do something like:

if(num.find(".00")){      #maybe this find method don't works, so see below

int(num)

}


Or directly, if you don't want do the condition:   int(num)

Examples:

num=0.999 -> int(num) -> num=0

num=123.456 -> int (num) -> num=123

アバター
破棄
関連投稿 返信 ビュー 活動
1
9月 24
3074
1
4月 24
1639
2
1月 24
1736
Error message 解決済
2
11月 23
2612
1
3月 24
1966