This is a migrated thread and some comments may be shown as answers.

Format decimal Places based on variable

1 Answer 1541 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Frank
Top achievements
Rank 1
Frank asked on 11 Jul 2016, 07:48 PM
I have a text box on a report that I would like to be able to format to a specific number of decimal places based on a variable.  Say if I pass a the value 3 it will be 3 decimal places or if I pass it a 5 it would be 5 decimals places.  Is something like Format("{0:N?}"  where the ? would be a variable, of is it only possible through a series if iif statements? 

1 Answer, 1 is accepted

Sort by
0
Stef
Telerik team
answered on 12 Jul 2016, 11:26 AM
Hi Frank,

Please test using the built-in Format text function in an expression like:
=Format('{0:N'+ Parameters.Parameter1.Value+'}',1233311.001234567)
where Parameter1 is an integer value in the example.

The idea is to build a dynamic format string.


I hope this information is helpful.

Regards,
Stef
Telerik by Progress
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
Tags
General Discussions
Asked by
Frank
Top achievements
Rank 1
Answers by
Stef
Telerik team
Share this question
or