July 26, 201114 yr Commercial Member I have a basic FSX math question...What's the best way to drop significant digits?I have a number with six digits and want to drop the last two...and reduce the precision.13579.321 -> 13600.000(L:myVar,number) 100 / near 100 *This works, and I use it, but it seems like a lot of trouble(L:myVar,number) 100 divdiv doesn't round the answer...so it won't doIs there a shortcut to do this?Danny
July 26, 201114 yr Moderator Danny, I can't think of any more "elegant" or "simple" way myself.Even substituting "ceil" instead of near wouldn't make any real difference... :( Fr. Bill AOPA Member: 07141481 AARP Member: 3209010556 Avsim Board of Directors | Avsim Forums Moderator
July 27, 201114 yr If you need to do it often and don't want to write it all out you could make a macro containing 100 / near 100 * and call it after the number you wish to round.
July 27, 201114 yr Author Commercial Member Thanks guys, good to know that's how you'd approach the problem.The macro is a good idea...My main concern was some of my statements were becoming very long and difficult to read.So that's an ideal use for a macro :( Danny
July 27, 201114 yr Moderator My main concern was some of my statements were becoming very long and difficult to read.So that's an ideal use for a macro :( Actually, that's the only real purpose for a macro! See my thread regarding the @ExtDigit macro for example. It's an elegant way to extract any digit from any number by simply passing along three parameters: (value,x,y) where x is the nth digit from the right, and y is the number of decimals (if any). Fr. Bill AOPA Member: 07141481 AARP Member: 3209010556 Avsim Board of Directors | Avsim Forums Moderator
Create an account or sign in to comment