Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
4308 Vizualizări

Hallo,

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

Thanks

Imagine profil
Abandonează
Cel mai bun răspuns

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

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
1
sept. 24
3192
1
apr. 24
1810
2
ian. 24
1839
2
nov. 23
2740
1
mar. 24
2069