small fixes

This commit is contained in:
Arseni
2026-02-17 11:17:19 +03:00
parent 0eea39fb97
commit e2e2257167
13 changed files with 120 additions and 58 deletions

View File

@@ -0,0 +1,12 @@
import 'package:pshared/models/money.dart';
double parseMoneyAmount(String? raw, {double fallback = 0}) {
final trimmed = raw?.trim();
if (trimmed == null || trimmed.isEmpty) return fallback;
return double.tryParse(trimmed) ?? fallback;
}
extension MoneyAmountX on Money {
double get amountValue => parseMoneyAmount(amount);
}