Sha256: 83f8a8eb130afcd20b6b7ca457f512fbb366914ac9d1bf9e32ab72ccd2caf682
Contents?: true
Size: 525 Bytes
Versions: 6
Compression:
Stored size: 525 Bytes
Contents
number = {} local numberToMonth = { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" } function number.toMonth(n) n = tonumber(n) return numberToMonth[n] end function number.tocurrency(n) return "$" .. number.commaSeperate(n) end function number.commaSeperate(n) local formatted = tostring(n) while true do formatted, k = string.gsub(formatted, "^(-?%d+)(%d%d%d)", '%1,%2') if k ==0 then break end end return formatted end
Version data entries
6 entries across 6 versions & 1 rubygems