javascript number format indian currency

function formatToCurrency(amount){
    return (amount).toFixed(2).replace(/\d(?=(\d{3})+\.)/g, '$&,'); 
}
formatToCurrency(12.34546); //"12.35"
formatToCurrency(42345255.356); //"42,345,255.36"

4.33
9
Mai Ly 85 points

                                    Steven Jasper C

4.33 (9 Votes)
0
4.4
5

                                        var x=12345678;
    x=x.toString();
    var lastThree = x.substring(x.length-3);
    var otherNumbers = x.substring(0,x.length-3);
    if(otherNumbers != '')
        lastThree = ',' + lastThree;
    var res = otherNumbers.replace(/\B(?=(\d{2})+(?!\d))/g, ",") + lastThree;
    alert(res);

4.4 (5 Votes)
0
3
1

                                    (1234567.8).toFixed(2).replace(/(\d)(?=(\d{2})+\d\.)/g, '$1,') // "12,34,567.80"

3 (1 Votes)
0
Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
node js format number currency format as currency javascript js currency format how to format currency as number javascript javascript format to currency how can we convert the indian rupees to dollars in js currency format in javascript how to format money as currency javascript javascript to format currency format number currency javascript intl format to currency javascript format number to money javascript javascript number format currency convert number to indian rupees currency javasccript currency format js how to format indian rupee in javascript indian currency format javascript format numbers to usd currency in javascript currency format in js number to money format javascript number to indian rupees js India currency code js format number into currency javascript js format currency currency js format convert number to rupees in javascript how format number as indian currency in js hown format number as indian currency in js hown format number as currency in js js format currency function convert no to rupees js format currency in javascript currency format javascript currency format js code how to format number to currency in javascript javascript format currency format currency javascript javascript currency format js number format currency format currency to number javascript format number to currency javascript javascript number format indian currency rupees in js convert number to words in indian rupees in javascript current format for india in javascirpt javascript convert india rupess to k format convert the currency in indian rupees in javascript how to show number in indian format in india and in international format elsewhere in javascript indian currency format in jquery add commas to number javascript indian way add commas to number javascript insian way comma separated money in indian regex javascript convert number to indian currency in javascript how to format rupees in javascript javascript number format currency inr how to separate paisa in javascript how to convert any given number in rupees using javascript how to add comma in input type number in indian currency indian currency input value format jquery add comma in number jquery indian currency currency format lakh js int currency javascripr javascript indian currency format to locale string indian currency javascript not working amount is show on indian rupee type comma separation in js convert number to indian rupee format in javascript
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source