var digituppercase = function (n) {var fraction = [' angle ', ' minute ']; var digit = [' 0 ', ' one ', ' II ', ' III ', ' establishments ', ' Wu ', ' Lu ', ' qi ', ' ba ', ' JIU ']; var unit = [[' Meta ', ' million ', ' billion '], [', ' Pick ', ' bai ', ' thousand ']; var head = N < 0? ' Owes ': '; n = Math.Abs (n); var s = '; for (var i = 0; i < fraction.length; i++) {s + = (Digit[math.floor (n * * * MATH.POW (ten, I))%] + fraction[i ]). Replace (/0./, '); } s = S | | ' Whole '; n = Math.floor (n); for (var i = 0; i < unit[0].length && n > 0; i++) {var p = '; for (var j = 0; J < unit[1].length && n > 0; j + +) {p = digit[n%] + unit[1][j] + p; n = Math.floor (N/10); } s = p.replace (/(0.) * 0 $/, '). Replace (/^$/, ' 0 ') + unit[0][i] + s; } return head + s.replace (/(0.) * 0 yuan/, ' Yuan '). Replace (/(0.) +/g, ' 0 '). Replace (/^ whole $/, ' 0 yuan whole '); }; Console.log (Digituppercase (7682.01)); Seven thousand land bai Ba pick aSub-console.log (Digituppercase (7682)); Seven thousand land Bai Ba to pick the Console.log (Digituppercase (951434677682.00)); Jiu Wu Bai a restaurant billion three hundred thousands of land pick qi thousand hundred ba
jquery number to uppercase amount