摘要: 一种是直接在试图中队价格信息进行格式化如:<div class="price"><%=sprintf("¥%0.02f",product.price)%></div>另外一种是用单独的辅助方法来处理价格格式化,即number_to_currency,如:<div class="price"> <%=number_to_currency(product.price)%></div>显示结果为$100.00<div class="price" 阅读全文
posted @ 2011-02-24 13:55 lonelystarxing 阅读(689) 评论(0) 推荐(1) 编辑