Forum Discussion
ChristianW
OneStream Employee
4 years agoAvoid "&&" in string operations?
Hi all
How can I avoid the ampersand in string operations? I need to concatenate a pov for a calculation, but with all the ampersands, it looks complicated:
"A#" & accountName & ":F#" & flowName ...
- 4 years ago
If you use the $" you can avoid all ampersands and ease the reading of calculation strings.
instead of
"A#" & accountName & ":F#" & flowName & ":UD2#" & ud2Name & ":UD4#" & ud4Name
you can simply write
$"A#{accountName}:F#{flowName}:UD2#{ud2Name}:UD4#{ud4Name}"
ChristianW
OneStream Employee
4 years agoIf you use the $" you can avoid all ampersands and ease the reading of calculation strings.
instead of
"A#" & accountName & ":F#" & flowName & ":UD2#" & ud2Name & ":UD4#" & ud4Name
you can simply write
$"A#{accountName}:F#{flowName}:UD2#{ud2Name}:UD4#{ud4Name}"
- ChristianW4 years ago
OneStream Employee
You can also format the variables like this:
$"Don't mess with Debit and Credit the difference {deltaDC:N2} is larger than 100"DeltaDC is a decimal and will be used in the N2 number format.