Certain Numbers Do Not Display Correctly

Viewing 9 reply threads
  • Author
    Posts
  • September 10, 2016 at 7:44 PM #19465

    W P
    Participant

    This is on an iPad version 5.0.3 (556).

    I created a form with 1 field being a number with 1 decimal place. No mask.

    I enter 98.1 into this field. It will display as 98.1 until I go to a different record and then come back to it. It then displays as 98.09999999999999. When I tap into it to edit it, it reverts back to 98.1 and will display normal again until I go to another record and come back.

    Also seems to happen when I do 94.9 but, I get 94.90000000000001 displayed. Again when I tap into it to edit it, it is 94.9.

    Interestingly enough, 107.9, 104.1 or 105.1 doesn’t do this. If for example, I change 94.9 to 194.9 it will display correctly. Remove the 1 and it displays wrong again. If I remove the 9 it will display at 4.9 all the time. Put the 9 back and it will display incorrectly. So, it seems to only happen to numbers where there are only 2 digits to the left of the decimal place and the digit to the right is a 1, 4, 6 or 9.

    Very odd indeed.

    September 11, 2016 at 12:17 AM #19467

    Brendan
    Keymaster

    Set the Number Format to Decimal on your field that that should take care of that problem.

    September 11, 2016 at 5:01 AM #19469

    W P
    Participant

    That works but, I don’t want the commas. I need it to be just numbers and the decimal point which is what looks like “No Style” would give me. Looks like the only solution at this point is to change the field type to text.

    September 11, 2016 at 9:06 AM #19472

    Brendan
    Keymaster

    It’s because the No Style option has no effect on the decimal places.

    September 11, 2016 at 3:01 PM #19488

    W P
    Participant

    Okay but, when I look at “No Style” in the selection, it shows “1234.56”. Plus, why does the display change what I’ve entered and when I edit the field it reverts it back to what I entered. I did a test export and it to shows the wrong value as well. Any program that the data gets imported into isn’t going to make those “data entry corrections”. I shouldn’t have to use a style to get it to show WHAT I entered in. Style to me means how it will be displayed (e.g. with the thousands separator).

    The big question is why would it change the value from what I entered of 98.1 and change it to 98.0999999999999? I clearly didn’t key that many digits to the right of the decimal point. It should keep the value of what was entered, 98.1, irregardless of what style is used.

    Another question is, why only on numbers that have 2 digits to the left of the decimal place and only certain numbers to the right?

    If this is how it deals with numbers, how can anyone that is doing calculations be assured that they are getting accurate results? Thankfully, I am not doing calculations on these fields. I set it to a number because it will make it easier to key in but, I guess I am going to have to change this to a text field so that it will display and export the value that I entered instead of the value it gets changed to behind the scenes.

    September 11, 2016 at 11:13 PM #19492

    Brendan
    Keymaster

    I’ll need to investigate this some more to find out why it’s behaving that way. The values are converted from the text you enter in into NSNumber objects, which may cause the transformation of the values by changing the precision.

    On iOS if you use a Text field, you can tell it to use the Number Keypad instead of the Text keyboard by default. So that may be an option for you.

    September 12, 2016 at 7:15 PM #19509

    W P
    Participant

    Thanks for that tip. I completely missed that setting about setting the default keyboard.

    September 13, 2016 at 4:12 AM #19510

    Jimmy Uptain
    Participant

    I can set the default keyboard but the settings don’t “take” on my iPad, just the iPhone.
    Am I missing a general setting on the iPad?

    September 13, 2016 at 4:40 AM #19511

    Jimmy Uptain
    Participant

    OK, I just found the issue.
    Turns out that the iPad doesn’t offer a number pad like the iPhone.
    Why Apple would do this is beyond me :(

    September 13, 2016 at 4:46 AM #19512

    W P
    Participant

    Jim,
    Not sure if there is an iPad setting. If you are looking for it to give you the keyboard that you get if it was a number field, I couldn’t find one that would. However, all of the number type keyboards did switch the keyboard to the number keyboard as if I hit the “.?123” key.

    If you mean it won’t switch at all, then I’m not sure why. Have you tried upgrading to the latest version? Have you tried rebooting the iPad? Those are the only suggestions I have.

    September 13, 2016 at 5:00 AM #19513

    Jimmy Uptain
    Participant

    Thanks dude!!
    That helps.

Viewing 9 reply threads

You must be logged in to reply to this topic.