Posted 13 May 2024, 12:32 am EST - Updated 13 May 2024, 12:37 am EST
Optional parameters in function
Posted by: Fabrice.Mainguene on 13 May 2024, 12:32 am EST
-
-
Posted 13 May 2024, 6:35 pm 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 13 May 2024, 6:57 pm EST
Thanks
-
Posted 15 May 2024, 8:09 pm 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