From e7410d4b0cdc06bee23895fad5042b852767fa6d Mon Sep 17 00:00:00 2001 From: Flaviano Rodrigues Date: Wed, 4 Dec 2024 19:19:00 -0300 Subject: [PATCH] adjust percent max --- package.json | 2 +- src/index.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 8e5c223..b7038e2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "flaformatter", - "version": "2.1.0", + "version": "2.1.1", "description": "A formatter to easily your code", "homepage": "https://github.com/Flaviano-Rodrigues/flaformatter", "repository": { diff --git a/src/index.ts b/src/index.ts index 7a267e3..ba29206 100644 --- a/src/index.ts +++ b/src/index.ts @@ -77,12 +77,12 @@ const flaformatter = ( max(16) break case 'percent': - // 12.34% com limite até 100% + // 12.34% let percentValue = parseFloat(val.replace(',', '.')) percentValue = percentValue / 100 - if (percentValue > 100) { + if (setMax && percentValue > 100) { percentValue = 100 }