Background: I want all numbers in InputField
's displayed as NumberForm[num,2]
;
Now, consider the following the snippet of code:
latsy = 1.1;
latparshx = 32;
piet = NumberForm[latsy*Tan[latparshx*Pi/180], 2];
InputField[Dynamic[piet], FieldSize -> 3]
This code produces an inputfield with a number between double quotes, which is not what I expected. I basically want 0.69 displayed.
Question: How can I ( what is the best way to ) control the display format of a number in an InputField ?
EDIT: The InputField resizes itself on the Panel it is positioned on and thus messes up the other GUI elements.
PrintPrecision -> 2
, and then useInputField[piet, Number, BaseStyle -> {"MyStyle"}]
(removing theNumberForm
wrapper frompiet
). This is the most I could dig up from the Documentation, and since I don't know how to define styles from a notebook, I'm stuck here. $\endgroup$