Skip to content

Instantly share code, notes, and snippets.

View risardi123's full-sized avatar
🐻‍❄️
I may be slow to respond.

Xeanorm risardi123

🐻‍❄️
I may be slow to respond.
View GitHub Profile
@mkmlh
mkmlh / limiterCommasOnInput.js
Last active October 14, 2021 15:36
delimiter
const delimiterNumberOnInput = (value, comma) => {
let number = value
if (number.charAt(0) === ",") {
number = ""
} else if (parseFloat(number) === 0 && number.charAt(1) !== ",") {
number = "0"
} else if (number.charAt(0) === "0") {
if (!(number.charAt(1) === ",")) {
number = number.charAt(1)
}