問題:
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