
1. Re: Format number in Chart Title based on Calculation
philmodjunk Mar 29, 2015 8:26 AM (in response to sccardais)Definitely possible. Is this always a whole number or might there be a decimal component that's part of the value?
A quick search of my tutorial section of the Known Bugs List database brings up one calculation for decimal points that I've adapted to include a currency symbol:
Let ([ x = YourNumberFieldHere ;
I = Int ( x ) ;
d = Mod ( x ; 1 )
];
"$" & I & If ( d ; Left ( d & "0" ; 3 ) ; ".00" )
)And I found a clever trick from raybaudi for the thousands separator:
NumToJText ( 1234 ; 1 ; 0 )
Will return: 1,234

2. Re: Format number in Chart Title based on Calculation
sccardais Mar 29, 2015 11:45 AM (in response to sccardais)Thank you. The NumtoJText "trick" worked well. Adding the "$" to the beginning of the calculation gives it the apprearance of formatting as "Currency." The SummaryField value of 6099840 now appears as $6,099,840.
Final calculation below.
"Annual Contract Value: " & If
(
ValueCount(TO_name::_Edition) = 1;
Upper(TO_name::_Edition & " $" & NumToJText (SummaryField ; 1 ; 0 ));
"ALL EDITIONS"&" $" & NumToJText ( SummaryField ; 1 ; 0 )
)