My last question leads me to this one:
wxTextCtrl:setValue( TcGrossProfit, io_lib:format("~.2f",[NewGrossProfit])),
generates an error from wxTextCtrl, with a bad arg.
I know this is the culprit
NewGrossProfit = 5.45333,
io_lib:format("~.2f",[NewGrossProfit])
Thanks for the last one, hope this one’s easier
-B
EDIT
Last Question:
Truncate a float in Erlang
The problem is that
io_lib:format("~.2f",[NewGrossProfit])returns an iolist:["5.45"], butwxTextCtrl:setValueseems to need a string ("5.45"). Soshould work.