问题:
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