Formatting multiple values in an expression

2 posts, 0 answers
  1. Scott
    Scott avatar
    3 posts
    Member since:
    Jan 2016

    Posted 09 Mar Link to this post

    I have a single cell that has data the following data:

    Weight  <unit of measurement> @ speed <unit of measurement>

    Example:  "40000 lbs @ 65 mph"      "18143 kg @ 105 km / h"

    Expression example:

    =Fields.weight + " " + IIf(uom = "metric", "kg", "lbs") + " @ " ......

    I am trying to find a way to do number formatting to add the thousands separator. Is there a way to format one specific field in an expression? I am trying to keep most of the formatting to be as native as possible, instead of user functions, in case the culture changes from "," to ".", etc.

  2. Stef
    Stef avatar
    2930 posts

    Posted 11 Mar Link to this post

    Hello Scott,

    You can use the built-in Format function and a standard numeric format string. Depending on the formatting string, decimal and group separators will be obtained from the current thread's culture information.

    Other approach is to use a custom function and format the values in code, includes using invariant formatter on conversion, replacing and formatting strings. If you need custom functions in the Standalone Designer tool, please follow the steps in Extending Report Designer.

    Let us know if you need any further help.

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. DevCraft banner
Back to Top