此问题在此处已有答案:
How do you round a double in Dart to a given degree of precision AFTER the decimal point?(29个回答)
14天前关闭
例如,我如何在Flutter( dart )中将8.245四舍五入到8.25?我还没有找到一个有效的方法。任何意见都很感激,谢谢。
此问题在此处已有答案:
How do you round a double in Dart to a given degree of precision AFTER the decimal point?(29个回答)
14天前关闭
例如,我如何在Flutter( dart )中将8.245四舍五入到8.25?我还没有找到一个有效的方法。任何意见都很感激,谢谢。
1条答案
按热度按时间jxct1oxe1#
在这种情况下,可以使用
toStringAsFixed
对于EX:-
字符串
欲了解更多信息,请访问https://api.dart.dev/stable/3.1.5/dart-core/num-class.html#id_toStringAsFixed