Rounding to certain number multiple

Rounding to certain number multiple

eyadthebest
Participant Participant
2,517 Views
7 Replies
Message 1 of 8

Rounding to certain number multiple

eyadthebest
Participant
Participant

hello,

I wan't to ask if Revit have a function that can round a formula output to the nearest  multiplier  of a number such as (26 cm ,52, 78, 104 etc)

the formula is a family parameter,if the output is 27 then it rounds it to 26

and if the output is 62 then it rounds it up to 78 etc...

 

thanks 

0 Likes
2,518 Views
7 Replies
Replies (7)
Message 2 of 8

Ilic.Andrej
Advisor
Advisor

 

round(a / 26) * 26

 

 

where "a" is a variable - user input.



Andrej Ilić

phonetical: ændreɪ ilich
MSc Arch

Autodesk Expert Elite Alumni

Message 3 of 8

barthbradley
Consultant
Consultant
Message 4 of 8

ToanDN
Consultant
Consultant
The rounding examples are not consistent. 27 to 26 is rounding down, 62 to 78 is rounding up even though 62 is closer to 52 than to 78.
Message 5 of 8

eyadthebest
Participant
Participant

yes sorry i meant like 68 to 78 

as some rounds up and some rounds down to the nearest interval 

thanks

0 Likes
Message 6 of 8

eyadthebest
Participant
Participant

thank you so much that worked perfectly as intended 👌

0 Likes
Message 7 of 8

eyadthebest
Participant
Participant

thank you that is a useful link 

 

Message 8 of 8

martijn_pater
Advisor
Advisor

yes, that's why @ToanDN has it preset in his signature... 😉

presetsignature.png

0 Likes