Sync errors from negative decimals without a leading zero: Android Capture 3.4.2 accepts them, server rejects them

Hi all,

I think I’ve found a validation gap in the Android Capture app and wanted to flag it.

Setup:

  • Android Capture app 3.4.2, Android 16 (Samsung, One UI 8.5)
  • DHIS2 2.41.9.1
  • Tracker program, data elements with value type Number (pediatric z-scores)

What happens:

  • If I enter .62, the app shows a formatting error and won’t accept it, which is what I’d expect.
  • If I enter -.62, the app accepts it with no error and saves it offline.
  • On sync, the server rejects it with: DataElement ' ' is not valid: 'Value type is NUMBER but the value '-.62' is not.'

Expected: -.62 should probably be rejected the same way .62 is, or normalized to -0.62 before saving.

I tried to catch it with a program rule, but the rule engine sees the value as -0.62 inside functions (d2:left returns -0), so as far as I can tell there’s no way to catch it on our end. For now we’re relying on field hints and fixing stuck values by hand before sync.

Happy to share more details if helpful. Thanks!

@dhis2-android

Hi @researchfd

Welcome to the DHIS2 Community of Practice, and thank you for reporting this! This is most likely a bug issue similar to this ticket: Jira

Would you like to create a jira bug issue for this? You’d need an account in jira.dhis2.org then click ‘Create’ issue type, bug and project ANDROAPP.