Categories: Science & Technology

Number To Text Converter on Google Sheet

Number To Text Converter on Google Sheet

Download Tex File

डाउनलोड करने के लिए डाउनलोड लिंक पर क्लिक करें

Copy the all code below and go to google sheet new script file and past the code and save the as new script file.

नीचे दिए हुए सभी कोड को कॉपी करें और गूगल शीट के स्क्रिप्ट में न्यू स्क्रिप्ट फाइल में पेस्ट करने बाद सेव करें.

Watch Complete Step By Step Process

इस विडिओ के मदद से आप गूगल शीट में अंक को शब्द मे लिख सकते हैं

Number to Word Converter
function INR(input) {


  var a, b, c, d, e, output, outputA, outputB, outputC, outputD, outputE;


  var ones = ['', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine'];


  if (input === 0) { // Zero


    output = "Rupees zero";


  } else if (input == 1) { // One


    output = "Rupee one only";


  } else { // More than one


    // Tens
    a = input % 100;
    outputA = oneToHundred_(a);


    // Hundreds
    b = Math.floor((input % 1000) / 100);
    if (b > 0 && b < 10) {
      outputB = ones[b];
    }


    // Thousands
    c = (Math.floor(input / 1000)) % 100;
    outputC = oneToHundred_(c);


    // Lakh
    d = (Math.floor(input / 100000)) % 100;
    outputD = oneToHundred_(d);


    // Crore
    e = (Math.floor(input / 10000000)) % 100;
    outputE = oneToHundred_(e);


    // Make string
    output = "Rupees";


    if (e > 0) {
      output = output + " " + outputE + " crore";
    }


    if (d > 0) {
      output = output + " " + outputD + " lakh";
    }


    if (c > 0) {
      output = output + " " + outputC + " thousand";
    }


    if (b > 0) {
      output = output + " " + outputB + " hundred";
    }


    if (input > 100 && a > 0) {
      output = output + " and";
    }


    if (a > 0) {
      output = output + " " + outputA;
    }


    output = output + " only";
  }


  return output;


}


function oneToHundred_(num) {


  var outNum;


  var ones = ['', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine'];


  var teens = ['ten', 'eleven', 'twelve', 'thirteen', 'fourteen', 'fifteen', 'sixteen', 'seventeen', 'eighteen', 'nineteen'];


  var tens = ['', '', 'twenty', 'thirty', 'forty', 'fifty', 'sixty', 'seventy', 'eighty', 'ninety'];


  if (num > 0 && num < 10) { // 1 to 9


    outNum = ones[num]; // ones


  } else if (num > 9 && num < 20) { // 10 to 19


    outNum = teens[(num % 10)]; // teens


  } else if (num > 19 && num < 100) { // 20 to 100


    outNum = tens[Math.floor(num / 10)]; // tens


    if (num % 10 > 0) {


      outNum = outNum + " " + ones[num % 10]; // tens + ones


    }


  }


  return outNum;


}

Recent Posts

  • Business Idea

How to Setup a Manufacturing Plant of Leather Purses?

How to Setup a Manufacturing Plant of Leather Purses? Starting a manufacturing plant for leather purses can be a profitable… Read More

9 minutes ago
  • Food Recipes

How to Make Curry Leaves Powder at Home? घर पर करी पत्ते का पाउडर कैसे बनाएं?

How to Make Curry Leaves Powder at Home? घर पर करी पत्ते का पाउडर कैसे बनाएं? Making curry leaves powder… Read More

12 minutes ago
  • Business Idea

How to Setup a Business Plant of Leather Jackets?

How to Setup a Business Plant of Leather Jackets? Setting up a business plant for manufacturing leather jackets can be… Read More

23 minutes ago
  • Food Recipes

How to Make Fennel Seed Chutney at Home? घर पर सौंफ की चटनी कैसे बनाएं?

How to Make Fennel Seed Chutney at Home? घर पर सौंफ की चटनी कैसे बनाएं? Fennel Seed Chutney is a… Read More

25 minutes ago
  • Business Idea

How to Setup a Plant of Leather Cricket Ball?

How to Setup a Plant of Leather Cricket Ball? Setting up a manufacturing plant for leather cricket balls can be… Read More

35 minutes ago
  • Business Idea

How to Setup a Business Plant of Lead Acid Battery?

How to Setup a Business Plant of Lead Acid Battery? 1. Conduct Market Research and Feasibility Analysis For Plant of… Read More

47 minutes ago

This website uses cookies.