ToString function bug?
Posted: Tue Feb 21, 2017 8:24 am
Hi,
When I use the expressioin of [Tools.ToInt(IPNumericUpDown1.Value*10).ToString("X4")] within control panel. I expected it works for both positive and negative numbers.
E.g. +1.5, it gave 000F, very good, no problem.
But when it came to negative numer, namely -1.5, it gave FFFFFFF1, eight characters instead of 4 that was explicitly required in the expression.
Could you help to confirm on this?
If this is really a bug, how can I work around it?
Thanks.
When I use the expressioin of [Tools.ToInt(IPNumericUpDown1.Value*10).ToString("X4")] within control panel. I expected it works for both positive and negative numbers.
E.g. +1.5, it gave 000F, very good, no problem.
But when it came to negative numer, namely -1.5, it gave FFFFFFF1, eight characters instead of 4 that was explicitly required in the expression.
Could you help to confirm on this?
If this is really a bug, how can I work around it?
Thanks.