From fffd3f8d9fa37b44ed989bf76314cb8e73be6f41 Mon Sep 17 00:00:00 2001 From: Austin Mroz Date: Tue, 20 Jan 2026 14:19:25 -0800 Subject: [PATCH] Add round option to floats --- src/extensions/core/customCombo.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/extensions/core/customCombo.ts b/src/extensions/core/customCombo.ts index d4a55367ef..00117f07c3 100644 --- a/src/extensions/core/customCombo.ts +++ b/src/extensions/core/customCombo.ts @@ -170,7 +170,16 @@ function onCustomFloatCreated(this: LGraphNode) { if (this.properties.step) return this.properties.step const { precision } = this.properties - return typeof precision === 'number' ? 10 ** precision : 1 + return typeof precision === 'number' ? 5 * 10 ** -precision : 1 + }, + set: (v) => (this.properties.step = v) + }) + Object.defineProperty(valueWidget.options, 'round', { + get: () => { + if (this.properties.round) return this.properties.round + + const { precision } = this.properties + return typeof precision === 'number' ? 10 ** -precision : 0.1 }, set: (v) => (this.properties.step = v) })