String formatCny(num value) {
  final fixed = value.toStringAsFixed(2);
  final parts = fixed.split('.');
  final whole = parts.first.replaceAllMapped(
    RegExp(r'(\d)(?=(\d{3})+(?!\d))'),
    (match) => '${match[1]},',
  );
  return '¥$whole.${parts.last}';
}

String formatGram(num value) => '${value.toStringAsFixed(2)}g';
