Rails:是否有将逗号添加到大数的 rails 技巧? - Rails: Is there a rails trick to adding commas to large numbers?

10/14 06:37
阅读数 0

问题:

Is there a way to have rails print out a number with commas in it?有没有办法让 rails 打印出一个带有逗号的数字?

For example, if I have a number 54000000.34, I can run <%= number.function %>, which would print out "54,000,000.34"例如,如果我有一个数字 54000000.34,我可以运行 <%= number.function %>,它会打印出“54,000,000.34”

thanks!谢谢!


解决方案:

参考一: https://en.stackoom.com/question/4WWh
参考二: https://stackoom.com/question/4WWh
展开阅读全文
打赏
0
0 收藏
分享
加载中
更多评论
打赏
0 评论
0 收藏
0
分享
返回顶部
顶部