Posted 13 May 2024, 9:32 am EST - Updated 13 May 2024, 9:37 am EST
Optional parameters in function
Posted by: Fabrice.Mainguene on 13 May 2024, 9:32 am EST
-
-
Posted 14 May 2024, 3:35 am EST
Hi Fabrice,
I was able to replicate the issue at my end with the latest version of SpreadJS V17.0.8. I could see that for some formulas like “SUBSTITUTE” the optional parameters are not enclosed within “”.
I have escalated this issue to the concerned dev team for further investigation. The internal tracking id for the same is: SJS-24224. I will let you know when there is more info on this from the dev team.
For a workaround, you could change the function parameters from the resources of the current culture. Refer to the following code snippet:
let resources = GC.Spread.Common.CultureManager.getResources(); let oldPrams = resources.Functions.SUBSTITUTE.parameters; // Change the Parameters resources.Functions.SUBSTITUTE.parameters = [oldPrams[0].name, oldPrams[1].name, oldPrams[2].name, `[${oldPrams[3].name}]`]; GC.Spread.Common.CultureManager.addCultureInfo('en-US', null, resources);
In the sample, the fourth parameter of the “SUBSTITUTE” function has been enclosed in “”.
Further, I could see that some other functions like “FIXED”, “DECIMAL” , “DAYS360” and more have the same issue. I have also mentioned these to the dev team.
References:
getResources() method: https://developer.mescius.com/spreadjs/api/classes/GC.Spread.Common.CultureManager#getresources
addCultureInfo() method: https://developer.mescius.com/spreadjs/api/classes/GC.Spread.Common.CultureManager#addcultureinfo
Regards,
Ankit
-
Posted 14 May 2024, 3:57 am EST
Thanks
-
Posted 16 May 2024, 5:09 am EST
Hi,
The devs have considered the issue as bug and a new bug issue has been created with internal tracking id: SJS-24260.
I will let you know when there is more info on this from the dev team or when the issue will be resolved.
Regards,
Ankit
-
Posted 11 July 2024, 10:24 am EST
Hi,
The mentioned issue has been resolved in the SpreadJS V17.1.0. Kindly upgrade to the latest version and let us know if you still face the same issue.
Regards,
Ankit