Jump to content
Macro Express Forums

Macro Express Pro - Does not support Float variable numbers?


Recommended Posts

Hi,

 

I'm trying to write a script which involves the following large decimal numbers: .000001 and .00001

 

When using the decimal variable it only goes up to .0001 and when storing anything larger than that I get a hex value equivalent. This poses a problem as when you paste it back into a field. It comes out with 1^EF or something like that.

 

Currently I have no choice but to set it as a string and then loading up the Calculator app and paste it in there to do the calculations. Its kind of crude, but works for now until MEP supports float variables or the equivalent.

 

Whats another work around does everyone else have?

 

thanks

Link to comment
Share on other sites

Hi,

 

I'm not sure I follow you. For a start, can we agree that you're talking about small not 'large decimal numbers'? I'm guessing you meant a large number of decimal places?

 

Where does hex come onto the scene? Values just get represented in exponential notation when precision exceeds a certain level. As in this macro:

Variable Set Decimal %dSmall% to 1.0123456789012345
Text Box Display: Initial entry
Variable Modify Decimal: %dSmall% = %dSmall% - 1
Text Box Display: Original - 1
 
Variable Modify Decimal: %dSmall% = %dSmall% / 10
Text Box Display: (Original - 1)/10
 
Variable Modify Decimal: %dSmall% = %dSmall% / 10
Text Box Display: (Original - 1)/100
 
Variable Modify Decimal: %dSmall% = %dSmall% / 10
Text Box Display: (Original - 1)/1000

--
Terry, East Grinstead, UK

 

TestSmallDecimals.mex

Link to comment
Share on other sites

I assume you are pasting into Excel. The problem is with Excel and not MEP. And it's scientific notation, not hexadecimal. EG .000000000123 will look like 1.23E-10. The E-10 part just means the decimal place was moved negative 10 places to the right. The value of the cell is exactly the same, it's just being displayed differently. You have to understand that with the exception of text Excel internally stores all data in a computer based value and using cell formatting you tell Excel how you want it displayed. EG a date is actually stored as an integer where 1/1/1900 = 1. Excel guesses how you want numbers formatted. Very large and very small numbers are easier to see and understand in scientific notation so this is what you get. However if you really want to see all those zeros, which I don't recommend, change the format. You can right click and choose "Format cells..." or hit CTRL+1. Then select number and choose the number of decimal places you want to show.

Link to comment
Share on other sites

I thought Macro Express Decimal Variables were Floating variables:

From the Macro Express Pro help:

A Decimal variable holds any type of number, such as 12.432 or -1.3. Note: A decimal variable value can range from 5.0 x 10^ -324 to 1.7 x 10^308 with 15 to 16 significant digits. This first example is a decimal expanded to include 324 leading zeros followed by the number 5, represented as .000(321 more zeros)5. The second range extends to 17 followed by 308 zeros which would look like 1700000000(300 more zeros).0. The numbers are rounded to 15 or 16 significant digits.


Compare with the Wikipedia description of Floating Point variables.

 

Macro Express does not, however, support scientific notation like 0.001017654 × 10^5.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...