0

I would like to convert a string to a number without loosing precision.

Example
select to_number('5.1') from dual
5.1
select to_number('5.10') from dual
5.1

How do i get 5.10 as the number in the second call ?

jhon.smith
  • 1,963
  • 6
  • 30
  • 56
  • 2
    You aren't losing any precision or scale. Numbers don't have leading ot trailing zeros. 5.1 == 5.10 == 5.100000000. If you need to see trailing zeros then you need to convert back to a string, explicitly or via client default display settings. – Alex Poole Jun 10 '21 at 09:59
  • you can get your answer from this [answer](https://stackoverflow.com/a/20119300/12862527) – Akashkumar Golakiya Jun 10 '21 at 10:02
  • Thanks Alex for bringing me back to my senses :).Thanks Akash for the link. – jhon.smith Jun 10 '21 at 10:19

0 Answers0