Need help removing trailing zeros

2013-06-26 Thread bandcamp57
Hello, i'm making a calculator and I want to be able to use decimals but I don't like it when it comes out as ex.12.0 when it should be 12. I tried using .rstrip(0.rstrip(.) but that never seemed to work. If anyone has a solution please let me know, all help is greatly appreciated. Code: def

Re: Need help removing trailing zeros

2013-06-26 Thread Joshua Landau
On 26 June 2013 23:02, bandcam...@gmail.com wrote: Hello, i'm making a calculator and I want to be able to use decimals but I don't like it when it comes out as ex.12.0 when it should be 12. I tried using .rstrip(0.rstrip(.) but that never seemed to work. If anyone has a solution please

Re: Need help removing trailing zeros

2013-06-26 Thread PyNoob
Sorry about that... And thanks for your help, but I don't quite understand. Would that make it off your example print({:g}.format(1.0))? -- http://mail.python.org/mailman/listinfo/python-list

Re: Need help removing trailing zeros

2013-06-26 Thread Joshua Landau
On 26 June 2013 23:21, PyNoob bandcam...@gmail.com wrote: Sorry about that... And thanks for your help, but I don't quite understand. That's fine, but... Would that make it off your example print({:g}.format(1.0))? I don't understand this sentence. But, hey, I forgot to check what level you

Re: Need help removing trailing zeros

2013-06-26 Thread PyNoob
I get it now! Thank you so much for your help, I really appreciate it. :) -- http://mail.python.org/mailman/listinfo/python-list