Method Community

 

Formatting number in email.

Last post 07-16-2014 9:04 AM by Method_Greg. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 06-25-2014 1:38 AM

    • Cindy
    • Not Ranked
    • Joined on 06-25-2014
    • Posts 4

    Formatting number in email.

    I'm trying to send out an email with details that include some dollar amounts. It seems like when I put the amounts into Action Result I can't seem to get $$$ formating. Is there some way of limiting to 2 decimal places as well as inject commas?

    --Cindy

  • 07-07-2014 9:10 AM In reply to

    Re: Formatting number in email.

    Hello Cindy,

       Sorry for the delayed reply.  The emails take the data from the table itself.  This means the field characteristics are set on the table.  You may have two types of fields.  One is Money and goes to two decimal places.  The next is decimal, which can be of any length but the length is defined in the table.  (The default is 2 decimal places).   Check the table to see if the fields you are using is of type Money or Decimal. To inset commas, try using the Character Function.  It has items that you can use to add spaces and commas to an action result.

    Greg

    Greg Bilous
    Community Support Specialist
    Method Integration
    g.bilous@method.me
    Toll Free: 1.888.925.6238
    Local and overseas: 416.847.0400 ex.756
    Fax: 416.640.6027
  • 07-14-2014 11:17 PM In reply to

    • Cindy
    • Not Ranked
    • Joined on 06-25-2014
    • Posts 4

    Re: Formatting number in email.

    So here's something I tried.

    I created a new table called "aaaaa". I created one column called "dollarsandcents" in it of type "Money" and I created a default screen to go along with it. On that automatically created screen I added a new section with a text box. I then extended the "select" action on the automatically sgenerated grid to "Retrieve Value From Table" using the "Screen Active RecordID" and populated into a text field either directly via the "Retrieve" action or via and action result and then pushing it to the text box. In either way the value shown suddenly has 4 decimal places (and no commas and such). I guess the trext boxes that are directly linked to the table seems to inherit formatting that maybe you can't get via pulling it via the "Retrieve" seems to loss the formatting.

    Thoughts?

    --Cindy 

  • 07-14-2014 11:40 PM In reply to

    • Cindy
    • Not Ranked
    • Joined on 06-25-2014
    • Posts 4

    Re: Formatting number in email.

    Something else I tried. Getting the numeric value...finding the "." with the character function...offsetting by 3 additional places and getting the left part via the character function again. That seems to work...but it seems like an insane work around to just format a random number that was originally a money field to look like money again.

  • 07-16-2014 9:04 AM In reply to

    Re: Formatting number in email.

    Hello Cindy,   

          You can do the rounding in a 'Basic Match Calculation'.  (There is another forum post on it here).  It would be setup by retrieving the value you want to round, adding 0 and selecting a rounding option.

         For commas in numbers, there isn't anything on the screens or actions that can do insertions of commas in decimals/numbers.  You can do it in the actual report designer or it can be done with the SQL override in a grid. 

    I hope this helps,

    Greg

    Greg Bilous
    Community Support Specialist
    Method Integration
    g.bilous@method.me
    Toll Free: 1.888.925.6238
    Local and overseas: 416.847.0400 ex.756
    Fax: 416.640.6027
Page 1 of 1 (5 items)