mirror of
https://github.com/justUmen/Bjornulf_custom_nodes.git
synced 2026-03-21 20:52:11 -03:00
0.29
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
from decimal import Decimal, ROUND_HALF_UP
|
||||
class LoopFloat:
|
||||
|
||||
@classmethod
|
||||
@@ -17,8 +18,12 @@ class LoopFloat:
|
||||
|
||||
def create_loop_float(self, from_this, to_that, jump):
|
||||
range_values = []
|
||||
current_value = from_this
|
||||
current_value = Decimal(str(from_this))
|
||||
to_that = Decimal(str(to_that))
|
||||
jump = Decimal(str(jump))
|
||||
|
||||
while current_value <= to_that:
|
||||
range_values.append(round(current_value, 2)) # Round to two decimal places
|
||||
range_values.append(float(current_value.quantize(Decimal('0.01'), rounding=ROUND_HALF_UP)))
|
||||
current_value += jump
|
||||
return (range_values,)
|
||||
|
||||
return (range_values,)
|
||||
Reference in New Issue
Block a user