Skip to Content
Menu
This question has been flagged
1 Atsakyti
4258 Rodiniai

Hallo,

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

Thanks

Portretas
Atmesti
Best Answer

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

Portretas
Atmesti
Related Posts Replies Rodiniai Veikla
1
rugs. 24
3126
1
bal. 24
1679
2
saus. 24
1756
2
lapkr. 23
2653
1
kov. 24
1986