-2

For the value

x=1.48759 

I want output as

48759

example 2:

x=1.92345

output:

92345
Bill Hileman
  • 2,798
  • 2
  • 17
  • 24
  • 1
    Show what you have tried so far. Stackoverflow isn't a community where people are supposed to give you finished solution. They are there to help you troubleshoot and to guide you. You can turn those values into a string `str()` and then use `split(".")`. You'll get an array of strings and in one part you will find your desired output. – Tin Nguyen Jul 01 '20 at 12:50
  • see https://stackoverflow.com/questions/3886402/how-to-get-numbers-after-decimal-point – Cptmaxon Jul 01 '20 at 12:53
  • Thank you so much for your help. I got it how to solve. – priyanshi burad Sep 09 '20 at 08:32

1 Answers1

0

You can use regex for this case:

number = 1.49921
int(re.findall(r'\.(.*)',str(number))[0])

Outputs:

49921
Celius Stingher
  • 17,835
  • 6
  • 23
  • 53