Forum Discussion
Hey Jack, just wanted to understand how this issue occurs a little more.
Are you saying
- BRs get executed in the OneStream culture setting of the user
- So when Growth gets converted to a string as in Robb's example then it will convert a decimal to a string in the format of the user, so if user is French and Growth is 50.123/50,123 it will result in something like API.data.Calculate("A#Sales1 = A#Sales2 + 50,123”)? Which wouldn't work because OneStream would be expecting API.data.Calculate("A#Sales1 = A#Sales2 + 50.123”)?
Formulas expect numbers formatted in Invariant Culture (basically US), but in some contexts the process is actually executed under the user's own Culture, resulting in the behaviour you describe.
In addition, even if you convert from number to string in Invariant, there is a significant chance that numbers will be truncated, losing precision.
So the best approach is to never convert Decimals to String at all, and to assign them to a Formula Variable instead.
Related Content
- 2 years ago
- 3 years ago
- 9 months ago