Quantcast
Channel: BrainStorage
Viewing all articles
Browse latest Browse all 102

More Custom Formatting Fields For SharePoint Designer Emails

$
0
0

Here is another option for manhandling data to get around limitations in SharePoint Designer’s  ability to provide numeric formatting in workflow-generated emails. This post may be an alternative or a replacement for this earlier post, which describes a technique for displaying percentages in an aesthetically-pleasing manner in emails.

In today’s irritating workaround, the goal was to display numeric values in the email body, always with two decimal places. In my case, these number actually were currencies, but foreign currencies, so I could not choose to display the field as a Formatted Currency, as they would incorrectly show up as my locale-specific format ($US).

As a result, the only alternative in SPD is to choose String as the return type. This resulted in several possible problematic outputs, including the full floating-point value, e.g. 149999.99999997, or dropped trailing zeroes, e.g. 14755.20 would become 14755.2, or 25000.00 would become 25000.

So after some fiddling around, the solution, much like the earlier post, was to create special formatting fields strictly for use in my email output. In this case, I used the TEXT function with a format specifier string in a calculated field to coerce the desired output.

The calculated fields look like this, where the comma in the format specifier groups values by thousands, and the “.00″ forces two decimal display, regardless of the underlying value. For example, 123456 will be displayed as 123,456.00. I then updated my email to reference “FormattedCYTotSpent”, instead of the numeric field “CY Total Spent”.

A calculated field to force two decimal place output

A calculated field to force two decimal place output, grouped by thousands


Filed under: SharePoint, SharePoint Designer, Site Customization, Workflow Tagged: Decimal, Email, numeric formatting, SharePoint Designer

Viewing all articles
Browse latest Browse all 102

Latest Images

Trending Articles



Latest Images