这是我的代码,
Globalize.format(50.635676576567%, 'n2')
它抛出语法错误,因为%已被添加到数字中。但我需要将输出显示为 50.64%。如何实现通用方式{注意:符号可以是任何字符或特殊数字等任何东西......}
例子:
Globalize.format(50.635676576567%, 'n2') = 50.64%
Globalize.format(50.635676576567C, 'n2') = 50.64C
Globalize.format(50.635676576567@, 'n2') = 50.64@
Globalize.format($50.635676576567, 'n2') = $50.64
Globalize.format(#50.635676576567, 'n2') = #50.64
Globalize.format(50.635676576567world, 'n2') = 50.64 world
如何实现?