Desired result isn't well-written. Also might be missing specification that 1.6 millions would be displayed as 1.6 instead of 1.60.
I feel that your code would display 1000010 as 1.00 Mil.
I think that by creative use of tonumber(format) the same would be more efficiently achieved.
|