Remove the insignificant zeros for non-data fields.#97
Remove the insignificant zeros for non-data fields.#97raspopov wants to merge 1 commit intosanny32:devfrom
Conversation
|
This is by design. The leading zeros means that the field is designed for unsigned input. |
And what purpose do those extra zeros serve? And why, then, isn't that functionality included in the configuration dialog? |
In the register window, the address and length input fields have insignificant zeros on the left, which is confusing because this is how numbers are represented in the octal number system. This happens because the leading zeros display setting (enabled by default) is applied not only to the register map, but also to the address, length, and node number input fields for some reason. The FormModSim::_leadingZeros class variable has been added.
3afe9cb to
ff49d83
Compare
'Show leading zeros for unsigned values' option on/off leading zeros. |
|
DisplayDefinition dialog will be changed or removed due to application redesign |
However, the Address, Length, and Unit ID input fields are not unsigned values, nor are they values at all. I just can't figure out the logic... |
In fact, they are unsigned values because they cannot be less than zero. |
Leading zeros in a number have no bearing on whether it is signed or unsigned, nor on how much memory it occupies. For example "-00123". 😎 Please explain what use case is implemented here. |
In my understanding, the leading zeros mean an unsigned type |

In the register window, the address and length input fields have insignificant zeros on the left, which is confusing because this is how numbers are represented in the octal number system.
This happens because the leading zeros display setting (enabled by default) is applied not only to the register map, but also to the address, length, and node number input fields for some reason.
The
FormModSim::_leadingZerosclass variable has been added.