flutter comma intl
import 'package:flutter/material.dart';
import 'package:intl/intl.dart' show NumberFormat;
// 전역 변수
class Common {
// static String localcontextUrl="http://192.168.0.8:8080";
static String contextUrl="http://192.168.0.8:8080";
// 일반적인 alert 창 제어
static void Alert(BuildContext context, String titles, String message) {
var alert = new AlertDialog(
title: new Text(titles),
content: Container(
child: Row(
children: <Widget>[Text(message)],
),
),
actions: <Widget>[
new FlatButton(
onPressed: () => Navigator.pop(context),
child: Text(
"확인",
style: TextStyle(color: Colors.black),
))
],
);
showDialog(
context: context,
builder: (_) {
return alert;
});
}
/* 숫자를 세자리 마다 콤마를 부여한 문자열로 반환 */
static String numberWithComma(int param){
return new NumberFormat('###,###,###,###').format(param).replaceAll(' ', '');
}
}
댓글
댓글 쓰기