ãä¼è¨ãªã©ã§ã¯ããæ¡ãææ¡ããããããã«ï¼æ¡ãã¨ã«ã«ã³ãåºåããããã®ãä¸è¬çã ããä¸çºå¤æããé¢æ°ã¯ãªãã æ°åã«ã«ã³ããä»ãã ãããnumericåï¼intåï¼ãªãto_sã§æååã«å¤æãããä¸è¨ã®æ¹æ³ã¯ä¸æ¦æåãå転ããã¦å¾ãããï¼æåæ¯ã«ã«ã³ããå ¥ãã¦ãæåãããä¸åº¦å転ããããæ¡æ°ãææ¡ãã¦ããã°é ããã«ã³ããå ¥ããããããæ¡æ°ææ¡ã®å¦çãæ¸ãããããªãå転ããã¦æ«å°¾ããã«ã³ããå ¥ããæ¹ãå¿ ãï¼æåæ¯ãªã®ã§ç°¡æ½ã«è¨è¿°ã§ããã num = 1234567890 p num.to_s.reverse.gsub( /(\d{3})(?=\d)/, '\1,').reverse # "1,234,567,890" æ°åã®ã«ã³ããå¤ã ä»åº¦ã¯ã«ã³ããã¤ãã¦ããæ°åããã«ã³ããå¤ããã«ã³ããå¤ãæ¹æ³ã¯ã«ã³ããæ¢ãã¦é¤å»ããã°è¯ãã®ã§ãå転ããå¿ è¦ã¯ãªããæååããæ°å¤ã«æ»ãã¨ãã¯to_iã§
{{#tags}}- {{label}}
{{/tags}}