当前位置:网站首页>Dart 开发技巧
Dart 开发技巧
2022-06-30 09:34:00 【InfoQ】
Dart 中字符串货币格式的简单扩展
void main() {
print("1000".currency());
print("1300000".currency());
print("1005000".currency(symbol: '£'));
print("1000000".currency(symbol: '€'));
}
extension StringFormatter on String{
String currency({String symbol = "\$"}) {
int step = 1;
String val = this;
for (var i = val.length-1; i >=0; i--) {
if (i - 2*step > 0) {
val = val.replaceRange(i-2*step, i-2*step, ",");
step++;
}
}
return "$symbol$val";
}
}

使用 Flutter 在 Android 12 上验证 Android 应用链接
它是如何工作的?
await DomainVerificationManager.isSupported;- 已验证:已通过 Android 应用链接验证的域
- 已选中:未通过验证,但用户手动关联应用的域。
- 无:任何其他域
await DomainVerificationManager.domainStageVerified;
await DomainVerificationManager.domainStageSelected;
await DomainVerificationManager.domainStageNone;改变状态
await DomainVerificationManager.domainRequest();结论
边栏推荐
- 桂林 穩健醫療收購桂林乳膠100%股權 填補乳膠產品線空白
- 目标检测yolov5开源项目调试
- Small program learning path 1 - getting to know small programs
- Deep understanding of kotlin collaboration context coroutinecontext
- Guilin robust medical acquired 100% equity of Guilin Latex to fill the blank of latex product line
- Function simplification principle: save if you can
- JVM memory common parameter configuration set
- Couldn't load this key (openssh ssh-2 private key (old PEM format))
- Niuke rearrangement rule taking method
- Using OpenCV Net for image restoration
猜你喜欢

9.JNI_ Necessary optimization design

仿照微信Oauth2.0接入方案

MySQL explain

Solution to the eighth training competition of 2020 Provincial Games

Idea shortcut key settings

Deep understanding of continuation principle

JVM tuning tool commands (notes)

Find the number that appears only once in the array

MySQL-- Entity Framework Code First(EF Code First)

机器学习笔记 九:预测模型优化(防止欠拟合和过拟合问题发生)
随机推荐
Distributed ID
八大排序(二)
Terminal -- Zsh of terminal three swordsmen
Express の post request
Coredata acquisition in swift sorting, ascending, descending
Pytorch for former Torch users - Tensors
Use of Baidu face recognition API
Deep Learning with Pytorch-Train A Classifier
Properties of string
POJ 1753 flip game (DFS 𞓜 bit operation)
Startup of MySQL green edition in Windows system
utils 协程
MySQL index optimization miscellaneous
8.8 heap insertion and deletion
ES6 learning path (III) deconstruction assignment
Niuke rearrangement rule taking method
Baidu map JS browsing terminal
Duplicate entry '2' for key 'primary appears in JPA‘
八大排序(一)
桂林 穩健醫療收購桂林乳膠100%股權 填補乳膠產品線空白