开发者

inserting commas to separate large number?

HI

Is there a way i can add commas to a nu开发者_如何学Pythonmber like so:

num= 1234567

then becomes

num = 1,234,567

I would like to make this call in my helper i.e module

thanks


Use number_with_delimiter.

From your helpers:

number_with_delimiter(12345678)       # => 12,345,678

UPDATE: The code for the method.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜