I want to format Price and print it in proper format. For example, 5000000 will be displayed as $5,000,000. Can anyone tell me how it can be done?
<span data-bind="text:Price"></span>
<span data-bind="function()"></span>
Can I write an inline function which will take the value and format it? Can the value of text: Price be passed to formatfunction()?
formatfunction(label){return '$' + label.value.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");