Sending Float number to arduino with SerialCommandHandler.AddVariable

Support forum for MegunoLink
Post Reply
crossflow
Posts: 1
Joined: Mon Dec 26, 2016 8:47 pm

Mon Dec 26, 2016 9:06 pm

Dear developers all,

here http://www.megunolink.com/documentation ... d-handler/
says that float type is supported in SerialCommandHandler.AddVariable, that's true,
unfortunately on the interface panel side, the decimal mark supported in NumericUpDown objects is the "comma", but it should be the "dot".

Please could you suggest a solution using SerialCommandHandler.AddVariable for float numbers and NumericUpDown objects?
thanks
Paul
Posts: 33
Joined: Wed Jun 10, 2015 10:35 pm

Sun Jan 15, 2017 7:48 am

Hi,

Thanks for reporting that; I've added it to our list of bugs.

This happens if your windows localization settings are set to a region that uses a comma as a decimal separator. Until I get it fixed, you can use this as a workaround in the interface panel:

Code: Select all

!SetPoint [num.Value.ToString().Replace(",",".")]\r\n
This code converts the value from the numeric up/down control into a string then replaces any commas with decimal points.

Have a great day,
Paul.
Post Reply