[英]How to strip of the trailing decimal point only if it has no values after the point
[英]How to keep the trailing zeros after decimal point
所以我的 Alteryx 输出会截断小数点后的尾随零,这使我很难应用诸如添加“%”之类的字符串操作
所以像这样:
Alteryx Column
38.5
23.75
27
Current Output by adding "%"
38.5%
23.75%
27%
Desired Output
38.50%
23.75%
27.00%
对于这些数字,您可以使用:
format_number(col, 2) || '%'
或printf()
:
printf('%0.2f%%', col)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.