A field of type text is storing currency but if digits exceeding 16 digits then a decimal is introduced

Hi all ,
this is one of the input field of type (number) and is showing valid digits till 17 digits and beyond it only shows 0
image

I have added the same field in my DB but changed it type to text this time
image
NOTE: both fields are storing inputs from an input field which looks like this below
image

my question is when i enter a large number (digits > 16) , then for the field of type text (which is converted to text) is introducing a decimal and for the field of type number the scientific notation’s ‘e’ exponsial is introduced . I don’t want either of them , i want to just show the digits as it is even if total digits > 16.

Any help is really appreciated.

You can set the Content format of the input from Currency to Text (numbers only)

Thanks @Zeroic , i would work definately already explored that , but my project requirements (some modules) are meant to be this way. Anyways thanks.

In case you need to use these numbers (stored as texts) later on for calculations, you can also use the :converted to number operator

Apart from this, if you feel there might be a different use-case, let me know :slight_smile:

Converted to a number works fine but only when digits <= 16 , if I enter a larger number (digits > 16 ) then an exponential is introduced , so even if i do converted to a number a decimal is always introduced.

In what cases do you need to use :converted to number?

In Bubble (and in Javascript) the ‘Number’ datatype has limitations in precision and accuracy, with the highest number it can accurately represent being 9007199254740991

Beyond that, they will be subject to precision errors and cannot be reliably used for accurate calculations (as Bubble doesn’t support a BigInt datatype).

What exactly are you doing with numbers that large? Do they really need to be stored as numbers (i.e. are you performing numerical operations on them)? What do they represent? And do you really need such a high degree of accuracy with such incredibly large numbers?

2 Likes

This topic was automatically closed after 70 days. New replies are no longer allowed.