How to prevent TextField to automatically convert a string like "678192091" to 6.78192091e+8



I am NS new-bee. I am try to use TextField to scan bar codes.

But whenever a string looks like number, the TextField automatically convert it to scientific-notation number for example:

I expect “678192091”, but in TextField I get “6.78192091e+8”.

Could you help to prevent TextField from doing that?

Thanks a lot,

Son Lam.


EDIT: Not static but normal methods:



I simple don’t want to convert to number. I would like to get it as a string.



I think that’s what Number’s .toXXX() methods do: convert to string


This works in HTML:

<!DOCTYPE html>

<p>Click the button to display the formatted number.</p>

<button onclick="myFunction()">Try it</button>

<p id="demo"></p>

function myFunction() {
    var num = 678192091;
    document.getElementById("demo").innerHTML = num.toFixed(0);



Have a look here:


Thanks so much for help.

I wonder if has any attributes to declare that the input it for string and do no convert to number in any format.

Although the value is a string, and it is looks like a number, just converts the string to number, which is very inconvenience.

Best Regards,


I don’t really get what you mean… The content of the TextField in TypeScript will of course be a string, but in JavaScript, things are loosely typed, so if the JavaScript runtime thinks it looks like a number, it will probably store it internally as a number type.

How does the barcode get into the TextField in the first place? Can you share some of your code so I can see what exactly is going on?