New to Kendo UI for jQueryStart a free 30-day trial

ToString

methods

Formats a Number or Date using the specified format and the current culture.

Parameters:valueDate|Number

The Date or Number which should be formatted.

formatString

The format string which should be used to format the value. Number formatting and date formatting depends on the current culture.

Returns:String

the string representation of the formatted value.

<script src="https://kendo.cdn.telerik.com/2026.3.811/js/cultures/kendo.culture.de-DE.min.js"></script>
<script>
  // Format a number using standard number formats and default culture (en-US)
/* The result can be observed in the DevTools(F12) console of the browser. */
  console.log(kendo.toString(10.12, "n"));  // "10.12"
/* The result can be observed in the DevTools(F12) console of the browser. */
  console.log(kendo.toString(10.12, "n0")); // "10"
/* The result can be observed in the DevTools(F12) console of the browser. */
  console.log(kendo.toString(10.12, "n5")); // "10.12000"
/* The result can be observed in the DevTools(F12) console of the browser. */
  console.log(kendo.toString(10.12, "c"));  // "$10.12"
/* The result can be observed in the DevTools(F12) console of the browser. */
  console.log(kendo.toString(0.12, "p"));   // "12.00 %"

  // Format a number using custom number formats
/* The result can be observed in the DevTools(F12) console of the browser. */
  console.log(kendo.toString(19.12, "00##")); // "0019"

  // Format a number using standard number format and a specific culture de-DE (default culture is en-US)
/* The result can be observed in the DevTools(F12) console of the browser. */
  console.log(kendo.toString(10.12, "c", "de-DE")); // "10,12" €

  // Format a date
/* The result can be observed in the DevTools(F12) console of the browser. */
  console.log(kendo.toString(new Date(2010, 9, 5), "yyyy/MM/dd" ));         // "2010/10/05"
/* The result can be observed in the DevTools(F12) console of the browser. */
  console.log(kendo.toString(new Date(2010, 9, 5), "dddd MMMM d, yyyy" ));  // "Tuesday October 5, 2010"
/* The result can be observed in the DevTools(F12) console of the browser. */
  console.log(kendo.toString(new Date(2010, 10, 10, 22, 12), "hh:mm tt" )); // "10:12 PM"
</script>
Not finding the help you need?
Contact Support