reinforcedcc Posted April 21, 2018 Share Posted April 21, 2018 This is the foundation for the house, at this stage calculate the volume. Transmitted to the text. There it is necessary to delete unnecessary figures. fund.hip Quote Link to comment Share on other sites More sharing options...
StepbyStepVFX Posted April 21, 2018 Share Posted April 21, 2018 (edited) Check this thread, there may be useful info for you want to do : Edited April 21, 2018 by StepbyStepVFX 1 Quote Link to comment Share on other sites More sharing options...
reinforcedcc Posted April 21, 2018 Author Share Posted April 21, 2018 thanks, it helped a lot, now everything works for me concrete - `{ float val = detail("../volume", "volume", 0); string whole = ftoa(int(val)); string fract = ftoa(frac(val)); fract = substr(fract, 2, 1); return whole + "." + fract; }` m3 fund1.hip 1 Quote Link to comment Share on other sites More sharing options...
Noobini Posted April 21, 2018 Share Posted April 21, 2018 (edited) here's mine, non-coder method...you can adjust decimals on the fly (which I think you can with your scripted method too) Example float 123.45678 01) int(123.45678) = 123 02) 123.45678%123 = 0.45678 03) 0.45678 * pow(10,n) gets n decimals to become 'integer' part (rint is to round the integer) 04) answer is part01.part03 fund_decimals.hipnc Edited April 21, 2018 by Noobini 1 Quote Link to comment Share on other sites More sharing options...
reinforcedcc Posted April 22, 2018 Author Share Posted April 22, 2018 # Multiline version V concrete - `{ d = int(ch("decimals")); v = detail("../volume", "volume", 0); string whole = ftoa( int(v) ); string fract = ftoa( rint(v % int(v) * pow(10,d)) ); return whole + "." + fract; }` m3 fund_decimals1.hipnc Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.