0

I have a currency field in one of my SharePoint 2013 lists...How do I automatically format the field.

Example:

If the user enters 30000 it should automatically format to 30,000 and if he enters 500000 it should format to 500,000

So the number should format to American dollar currency.

Can this be done using j query ?

2

If you set the column type to Currency while creating the column, then you will get the format you want without any coding.

Currency columns are auto-formatted.

  • But when I tried retrieving the field value using SPServices..it is not displaying..Actually I am trying to display it in a table – Dheeraj May 18 '17 at 11:09
  • Are you getting an error while retrieving? or it is being retrieved as plain 30000? – harshal gite May 18 '17 at 12:05
  • it is retrieving as 30000.0000 – Dheeraj May 18 '17 at 12:12
  • 1
    var value = 1250.223; var num = '$' + value.toFixed(2).replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,"); / – harshal gite May 18 '17 at 12:25
  • Its not working...am getting an error – Dheeraj May 22 '17 at 10:47
1

I had created and tested by creating a currency type field and working as per you requirement enter image description here

enter image description here

  • But when I tried retrieving the field value using SPServices..it is not displaying..Actually I am trying to display it in a table – Dheeraj May 18 '17 at 11:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.