'Problem with entering money value from user with Flutter
I get user double value with "Flutter Dart" language. But naturally, when I get a double value, it can only do dot (.) marking. Can I have it enter both period (.) and comma (,) markings at the same time without getting an error? Is something like this possible? Example: 1.750.50
try {
if (aciklamaController.text.trim().length > 0) {
SigortaKasko _kaydedilecekSigortaKasko = SigortaKasko(
kim: _currentUser.userID,
aciklama: aciklamaController.text,
fiyat: double.parse(fiyatController.text.replaceAll(",", ".")).abs()
keyboardType: TextInputType.numberWithOptions(
signed: true, decimal: true),
controller: fiyatController,
decoration: InputDecoration(
hintText: "Fiyat Tutarını Giriniz",
labelText: "Fiyat",
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(16))),
)),
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
