Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Instant Grammar Checker - Correct all grammar errors and enhance your writing

Semrush - keyword research tool

Linux Foundation Training and Certification

Teach Your Child To Read

Disclosure: My content contains affiliate links.

32,306 questions

42,481 answers

573 users

How to add commas in thousands place for a number in Dart

1 Answer

0 votes
import 'package:intl/intl.dart';

void main() {
  var formatter = NumberFormat('#,###,000');
  
  var x = 77076193;
  print(formatter.format(x));
  
  print(formatter.format(17867));
  print(formatter.format(745));
  print(formatter.format(7938));
  print(formatter.format(8477610));

}




/*
run:

77,076,193
17,867
745
7,938
8,477,610

*/

 



Learn & Practice Python
with the most comprehensive set of 13 hands-on online Python courses
Start now


answered Jun 24, 2023 by avibootz

Related questions

1 answer 64 views
2 answers 66 views
3 answers 69 views
69 views asked Oct 10, 2022 by avibootz
1 answer 49 views
49 views asked Oct 8, 2022 by avibootz
1 answer 48 views
...