From b9c63d54b92831ad6db0e874ff29e97add02258b Mon Sep 17 00:00:00 2001 From: dzc <2388224167@qq.com> Date: Wed, 12 Mar 2025 19:39:45 +0800 Subject: [PATCH] 11 --- lib/common/utils/app/app_price_tool.dart | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 lib/common/utils/app/app_price_tool.dart diff --git a/lib/common/utils/app/app_price_tool.dart b/lib/common/utils/app/app_price_tool.dart new file mode 100644 index 0000000..b57dc32 --- /dev/null +++ b/lib/common/utils/app/app_price_tool.dart @@ -0,0 +1,8 @@ +class AppriceTool { + static const int _fractionDigits = 2; + + static String fenToYuan(num? price) { + if (price == null) return "0"; + return (price / 100).toStringAsFixed(_fractionDigits); + } +}