About 50 results
Open links in new tab
  1. JavaScript equivalent to printf/String.Format - Stack Overflow

    Mar 4, 2009 · I'm looking for a good JavaScript equivalent of the C/PHP printf() or for C#/Java programmers, String.Format() (IFormatProvider for .NET). My basic requirement is a thousand …

  2. How do I format a date in JavaScript? - Stack Overflow

    805 If you need to quickly format your date using plain JavaScript, use getDate, getMonth + 1, getFullYear, getHours and getMinutes:

  3. Javascript How To Format An Integer As A Currency String?

    May 15, 2022 · I have an integer stored as US cents, ie 1700 cents. How can I convert that to a string that is $17.00 using javascript? I have tried toFixed and Intl.NumberFormat but they return $1700?

  4. How do I put variables inside javascript strings? - Stack Overflow

    1 You can implement your own format function that takes a string and key-value pairs. the function:

  5. javascript - How to format numbers? - Stack Overflow

    1 Or you could use the sugar.js library, and the format method: format ( place = 0 , thousands = ',' , decimal = '.' ) Formats the number to a readable string. If place is undefined, will automatically …

  6. javascript - How can I format a number with commas as thousands ...

    May 25, 2010 · I am trying to print an integer in JavaScript with commas as thousands separators. For example, I want to show the number 1234567 as "1,234,567". How would I go about …

  7. How can I format an integer to a specific length in javascript?

    I have a number in Javascript, that I know is less than 10000 and also non-negative. I want to display it as a four-digit number, with leading zeroes. Is there anything more elegant than the foll...

  8. javascript - How to format numbers as currency strings? - Stack Overflow

    This Stack Overflow thread discusses methods to format numbers as currency strings in various programming languages.

  9. Get String in YYYYMMDD format from JS date object?

    Jun 18, 2010 · I'm trying to use JS to turn a date object into a string in YYYYMMDD format. Is there an easier way than concatenating Date.getYear(), Date.getMonth(), and Date.getDay()?

  10. javascript - Display date/time in user's locale format and time offset ...

    I want the server to always serve dates in UTC in the HTML, and have JavaScript on the client site convert it to the user's local timezone. Bonus if I can output in the user's locale date format.