formatFeeRate function
Taux renvoyé par l'API (taxe, décimal : 0.017) formaté pour l'affichage : "1,7 %".
Implementation
String formatFeeRate(dynamic taxe) {
final rate = taxe is num ? taxe.toDouble() : double.tryParse('$taxe');
if (rate == null) return '';
final percent = (rate * 1000).round() / 10;
final text = percent == percent.roundToDouble()
? percent.toStringAsFixed(0)
: percent.toStringAsFixed(1);
return '${text.replaceAll('.', ',')} %';
}