Forum Discussion
rhankey
2 days agoContributor III
In short, the error you are getting is because you are attempting to concatenate a Decimal datatype without any conversion into a String. The simple fix would be:
api.Data.Calculate("A#520000 = A#430000 *" & Var1.ToString & ")
However, the above is problematic depending on the culture of the user running the script, should let's say they format numbers as "0.000,00" rather than "0,000.00". The safer way to do what you are doing is as follows:
Dim Var1 as Decimal = Math.Round(api.Data.GetDataCell("A#630000").CellAmount, 2)
api.Data.FormulaVariables.SetDecimalVariable("Var1",Var1)
api.Data.Calculate("A#520000 = A#430000 * $Var1")
Related Content
- 2 years ago
- 2 years ago
- 2 years ago
- 2 years ago
- 2 years ago