SimA Posted August 15, 2022 Share Posted August 15, 2022 Hello everyone I'm looking for an example of how to easily round in Marionette. I would like to determine whether to round up or down. a round of five would also be cool. who can help? Thanks and have a nice day Quote Link to comment
Pat Stanford Posted August 15, 2022 Share Posted August 15, 2022 I is the number of decimal points to round to. Since you want nothing after the decimal, set I to zero or just don't connect the input. 0.5 will round up. 0.499999 will round down. I don't know of an easy way to round to 0.5 1 Quote Link to comment
SimA Posted August 16, 2022 Author Share Posted August 16, 2022 Hello Pat Stanford 22 hours ago, Pat Stanford said: round I want to be able to determine how to round. For example, in the image above, I want to round down to a whole number. In my opinion, the "round" knot is not suitable for all applications. I miss: 1.8=1.0 1.3=2 Especially when I split a route, I need whole numbers to continue working. The problem is that the individual sections must have a minimum or maximum size (smaller than and larger than). I still don't find my solution really good. Are there better variants? Abrunden.vwx Quote Link to comment
rDesign Posted August 16, 2022 Share Posted August 16, 2022 Would either the 'ceiling' or 'floor' marionette nodes work for you? One rounds up to the next whole integer, the other rounds down to the next whole integer ceil = 'Return the ceiling of x, the smallest integer greater than or equal to x' floor = 'Return the floor of x, the largest integer less than or equal to x' 2 Quote Link to comment
herbieherb Posted August 17, 2022 Share Posted August 17, 2022 round to 0.5: round(x*2)/2 round to 0.05: round(x*20)/20 round to 0.1: round(x*10)/10 round up: round(x+0.49999999999) round down: round(x-0.499999999) round up to 0.05: round(x*20+0.4999999999)/20 3 Quote Link to comment
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.