Convert Text Number to its value

acron shared this question 4 years ago
Answered

If a numeric value is enter as a text string, how can the value the extracted?


"1,234 x 10^23" output to 123400000000000000000000


Thanks


Tony

Comments (8)

photo
1

define a then ParseToNumber(a, "1.234 10^18"), decimal with dot not comma, 10^23 is too big

photo
1

Not working in this case.


Tony

photo
1

in your capture I see parsetonumber(n_1,n_n); here the second argument was a number. the second argument must be a string.

use n_1=CopyFreeObject( n_n ) or parsetonumber(n_1,""n_n)

photo
1

Part of what I need is a way to Enter a exponential in scientific notation in the input box "Enter Scientific Notation" so I can use a text box to write as a number.


I seem to be having some trouble expressing my needs.

photo
2

I think that the \times and ^{ } added by standartform() is the problem. it is better change the message for the user; easiest 1.2345 10^4 in it. then the input box as text and parsetonumber() for comparing.

I can do you say eliminating chars of inputing texts but it is not small.

how you get ×? with the letter x? ×x are different

Files: foro.ggb
photo
1

Thanks, but I have tried "easiest 1.2345 10^4 in it. then the input box as text and parsetonumber()". When I input a number into the input box, GeoGebra immediately changes it to standard form on entry. I even tried to set the input field as a text field, but it is automatically changed into a numeric value. I'm perplexed.

photo
1

have you tried the attached file?

photo
2

I will check out what was done later today I will let you know more soon.


I'm working on another project with greater importance to classes right now.


Thanks

© 2022 International GeoGebra Institute