cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
dinesh_redhawk
Level 6

StrToNum Issue. How to handle larger numbers in Installscript?

Hello Friends,

I have a string value from a text file "8464216064" which needs to be converted to Number for some calculation.
But as there is limitation on NUMBER, the StrToNum function always returns 2147483648 which is the max limit for NUMBER datatype.

Basically the above string is the RAM size in Bytes which i need to convert to GB for that i need to convert it in number and calculate the GB value.

Please advise how to do this. This small issue has eaten my full day 😞

thanks in advance.
Labels (1)
0 Kudos
(3) Replies
chad_petersen
Level 9

I do not know how to accomplish that using InstallScript, but you could always use C# in a managed DTF custom action and have any data types available to you that C# provides.

But the learning curve on that might eat another day.

Chad
0 Kudos
chad_petersen
Level 9

I see you are not interesting in a separate DLL (although it is unseen to the end user) so my suggestion was maybe more for future possibilities. I've moved away from using InstallScript at all since it makes it much more difficult to port between InstallShield and WiX, whereas managed C# custom actions port nicely.

Chad
0 Kudos
rguggisberg
Level 13

I am a little late to this post... but in case anyone else runs into this problem... checkout the InstallScript Help for ConvertSizeToUnits.
0 Kudos