5

I am trying to design a user interface where the specific form that the user enters in InputFields are left unchanged. For example, if the user puts in a number in scientific notation, it would be really nice for that value in the field to stay the same, even though it is modified internally into a different form. None of the Hold-type functions seem to do what I want (and only Hold[Expression] seems to be an option in InputField anyway).

enter image description here

enter image description here

Any ideas?

Kevin Ausman
  • 2,267
  • 8
  • 16
  • 1
    InputField[Dynamic[var], Boxes]? .. combined with Dynamic[ToExpression@x] to use the evaluated values. – kglr Jul 25 '19 at 20:06

1 Answers1

8
InputField[Dynamic[var], Boxes]

enter image description here

Column[{InputField[Dynamic[var], Boxes], 
  Dynamic[var], 
  Dynamic[RawBoxes @ var], 
  Dynamic[ToExpression @ var] }]

enter image description here

kglr
  • 394,356
  • 18
  • 477
  • 896