Created
September 24, 2024 08:53
-
-
Save iebb/70137801e61c7a58b8950bbbc6644f12 to your computer and use it in GitHub Desktop.
Dart vs JS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import "package:intl/intl.dart"; | |
void main() { | |
final formatterID = NumberFormat.currency( | |
locale: "id-ID", // Rp1.234.567,89 Indonesian | |
symbol: "Rp", | |
decimalDigits: 1, | |
name: "IDR", | |
); | |
final formatterNL = NumberFormat.currency( | |
locale: "nl-ID", // Rp 1.234.567,89 Dutch | |
symbol: "Rp", | |
decimalDigits: 1, | |
name: "IDR", | |
); | |
final formatterEN = NumberFormat.currency( | |
locale: "en-ID", // Rp1.234.567,89 English | |
symbol: "Rp", | |
decimalDigits: 1, | |
name: "IDR", | |
); | |
print("ID: " + formatterID.format(1234567.8901)); | |
print("NL: " + formatterNL.format(1234567.8901)); | |
print("EN: " + formatterEN.format(1234567.8901)); | |
print("ID: " + formatterID.format(-1234567.8901)); | |
print("NL: " + formatterNL.format(1234567.8901)); | |
print("EN: " + formatterEN.format(-1234567.8901)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment