Skip to content

fix: locale-aware decimal input rejected before normalization in invoice amount validation #66

@Delgado74

Description

@Delgado74

Summary

In lib/screens/9receive_screen.dart, the _confirmRequestAmount() method validates
the raw amount text using double.tryParse directly, which rejects comma-decimal inputs
(e.g., 1,5 or 1 000,50) before _normalizeLocalizedNumber() can process them.
This blocks invoice creation for users in several supported locales (DE, FR, IT, PT, RU, ES).

Steps to Reproduce

  1. Set your device locale to one that uses comma as the decimal separator
    (e.g., German, French, Italian, Portuguese, Russian, Spanish).
  2. Open the receive screen and tap to create an invoice.
  3. Enter an amount like 1,5 or 1 000,50.
  4. Tap confirm — the amount is rejected as invalid even though
    _normalizeLocalizedNumber() exists and could handle it.

Expected Behavior

Comma-decimal inputs should be accepted and normalized via _normalizeLocalizedNumber()
before validation.

Suggested Fix

  • final amount = double.tryParse(_amountController.text.trim());
  • final amount = _normalizeLocalizedNumber(_amountController.text.trim());

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions