formated numbers flutter code example
Example 1: flutter intl currency
import 'package:intl/intl.dart';
void currency() {
Locale locale = Localizations.localeOf(context);
var format = NumberFormat.simpleCurrency(locale: locale.toString());
print("CURRENCY SYMBOL ${format.currencySymbol}");
print("CURRENCY NAME ${format.currencyName}");
}
Example 2: i want number before % symbol in flutter
void main() {
String str = "one.two";
print(str.replaceAll(".two", ""));
print(str.split(".").first);
String newStr = str.replaceRange(str.indexOf("."), str.length, "");
print(newStr);
String nums = "1,one.2,two.3,three.4,four";
List values = nums.split(".");
values.forEach(print);
}