function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
The_FoxThe_Fox 

Scontrol

Hi Guys,

Just a quick question, how to have Currency field displayed with user's formating in a s-control

Does the class dataCell  CurrencyElement is enough or not?

Thanks for the tips

Regards
The_FoxThe_Fox
Ok Quick and dirty. To enhance n= the number p = precision t = thousand separator d = decimal separator Please delete the # (I have to add it otherwise the forum swho a smiley)

function FormatNumber(n, p, t, d){ //v1.0 should take user locale for thousand and decimal separator

var m = (p = Math.abs(p) + 1 ? p : 2, d = d || ",", t = t || ".", /(\d+)(?:#(\.\d+)|)/.exec(n + "")), x = m[1].length > 3 ? m[1].length % 3 : 0; return (x ? m[1].substr(0, x) + t : "") + m[1].substr(x).replace(/(\d{3})(?=\d)/g, "$1" + t) + (p ? d + (+m[2] || 0).toFixed(p).substr(2) : ""); };