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 Answers 2

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.

6
  • But when I tried retrieving the field value using SPServices..it is not displaying..Actually I am trying to display it in a table Commented May 18, 2017 at 11:09
  • Are you getting an error while retrieving? or it is being retrieved as plain 30000? Commented May 18, 2017 at 12:05
  • it is retrieving as 30000.0000 Commented May 18, 2017 at 12:12
  • 1
    var value = 1250.223; var num = '$' + value.toFixed(2).replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,"); / Commented May 18, 2017 at 12:25
  • Its not working...am getting an error Commented May 22, 2017 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

1
  • But when I tried retrieving the field value using SPServices..it is not displaying..Actually I am trying to display it in a table Commented May 18, 2017 at 11:03

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.