Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>toLocaleString demo</title>
</head>
<body>
<p>See the console ❤</p>
</body>
</html>
 
console.clear();
print(1600.666666);
print(1600.666666, 'de-DE');
print(1600.666666, 'gb-GB', {
  minimumFractionDigits: 2,
  maximumFractionDigits: 2
});
print(1600, 'gb-GB', {
  minimumFractionDigits: 2,
  maximumFractionDigits: 2
});
function print(num, locale = 'gb-GB', opts = {}) {
  console.log( `${locale}, opts? ${!!Object.keys(opts).length} ${num} => ${num.toLocaleString(locale, opts)}` );
}
Output 300px

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
rempro
0viewers