• Amelia joe
  • NEWBIE
  • 0 Points
  • Member since 2022

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies

Hi,
In visualforce, there's code like

This can be used for string output formatting.

Is there simillar one in Apex, like

Dicimal d = 4000.0;
How can I convert it to a string like '4,000.0'

I tried 2 ways, both failed
1) d.format() , this will be displayed like '4,000'
2) String.format: don't know how to use this API. There's no document from SFDC about this