locked
How to keep comma separators in a string. RRS feed

  • Question

  • How to keep commas in  a numeric after converting to a string?

    1,222,345

    It should read.

    "1,222,345  are  now  available."
    Thursday, October 8, 2009 6:53 PM

Answers

  • A numeric doesn't have any commas in it. It is a display formatting. So there is nothing to keep but do the conversion with an inputmask. ie:

    ?

     

     

    TRIM(transform(1222345, '@B 99,999,999')) + ' are now available.'
    • Proposed as answer by Naomi N Friday, October 9, 2009 3:52 PM
    • Marked as answer by Xingwei Hu Tuesday, October 13, 2009 9:53 AM
    Thursday, October 8, 2009 7:13 PM
  • How to keep commas in  a numeric after converting to a string?

    1,222,345

    It should read.

    "1,222,345  are  now  available."

    ?

     

     

    TRANSFORM( 1222345, "999,999,999")


    Marcia G. Akins
    • Marked as answer by Xingwei Hu Tuesday, October 13, 2009 9:53 AM
    Thursday, October 8, 2009 7:16 PM

All replies

  • A numeric doesn't have any commas in it. It is a display formatting. So there is nothing to keep but do the conversion with an inputmask. ie:

    ?

     

     

    TRIM(transform(1222345, '@B 99,999,999')) + ' are now available.'
    • Proposed as answer by Naomi N Friday, October 9, 2009 3:52 PM
    • Marked as answer by Xingwei Hu Tuesday, October 13, 2009 9:53 AM
    Thursday, October 8, 2009 7:13 PM
  • How to keep commas in  a numeric after converting to a string?

    1,222,345

    It should read.

    "1,222,345  are  now  available."

    ?

     

     

    TRANSFORM( 1222345, "999,999,999")


    Marcia G. Akins
    • Marked as answer by Xingwei Hu Tuesday, October 13, 2009 9:53 AM
    Thursday, October 8, 2009 7:16 PM
  • It works. Thanks a lot.
    • Marked as answer by Lightening Thursday, October 8, 2009 7:48 PM
    • Unmarked as answer by Don Tan Friday, October 9, 2009 6:41 PM
    Thursday, October 8, 2009 7:18 PM
  • Hi lightening,
    Please mark the other replies as answers if they give you help.

    Best Wishes
    Xingwei Hu


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Tuesday, October 13, 2009 9:55 AM