0

i have one text field having number its displaying value like this '1000' but i need to display like this '1,000' for this i created formula field if i took return type number means it will achive but we can't do like that error coming inavalid return type. how can i achive this?

i used this code

TRIM(
  IF(LEN(userid__c)>15, LEFT(LPAD(userid__c,18,' '), 3) & ',','') &
  IF(LEN(userid__c)>12, LEFT(LPAD(userid__c,15,' '), 3) & ',','') &
  IF(LEN(userid__c)> 9, LEFT(LPAD(userid__c,12,' '), 3) & ',','') &
  IF(LEN(userid__c)> 6, LEFT(LPAD(userid__c, 9,' '), 3) & ',','') &
  IF(LEN(userid__c)> 3, LEFT(LPAD(userid__c, 6,' '), 3) & ',','') &
  IF(LEN(userid__c)> 0, LEFT(LPAD(userid__c, 3,' '), 3)      ,'')
)

but its not getting proper output if i gave '12345' means it returns '12,123'. please help on this

4
  • Write a formula VALUE(field__c). This will convert text data stored in field__c into a number. Commented Feb 15, 2017 at 13:20
  • Not sure there is a formula to take numbers like 12345 and turn them into 12,123 unless there is a set conversion factor. For straight text to number Rohit has the answer
    – Eric
    Commented Feb 15, 2017 at 13:25
  • 2
    Possible duplicate of- salesforce.stackexchange.com/questions/160451/…
    – Raul
    Commented Feb 15, 2017 at 13:25
  • I answered here. This has to be flagged as duplicate
    – o-lexi
    Commented Feb 15, 2017 at 22:00

0

You must log in to answer this question.

Browse other questions tagged .