This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- StrToNum Issue. How to handle larger numbers in Installscript?
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 21, 2017
06:46 AM
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.
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.
(3) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 21, 2017
10:24 AM
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
But the learning curve on that might eat another day.
Chad
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 21, 2017
11:24 AM
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
Chad
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 26, 2017
09:45 AM
I am a little late to this post... but in case anyone else runs into this problem... checkout the InstallScript Help for ConvertSizeToUnits.
