码迷,mamicode.com
首页 > 其他好文 > 详细

dart 格式化输出

时间:2020-06-16 23:07:35      阅读:247      评论:0      收藏:0      [点我收藏+]

标签:保留   fixed   pre   小数   radix   art   tostring   格式   ora   

类似于保留几位小数,直接 n.toStringAsFixed()

例如:
1.toStringAsFixed(3); // 1.000
(4321.12345678).toStringAsFixed(5); // 4321.12346
1000000000000000000000.toStringAsFixed(3); // 1e+21
5.25.toStringAsFixed(0); // 5
16进制输出

12.toRadixString(16);  // c

dart 格式化输出

标签:保留   fixed   pre   小数   radix   art   tostring   格式   ora   

原文地址:https://www.cnblogs.com/zhaofeis/p/13149622.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!