if a user updates the list by clicking either button and the number is below 1000, i want to get the text and add or subtract 1. if the number is above 1000, hence 1K, i want nothing to happen. all i have so far is this code which works for numbers under 1000 and not numbers abbbreviated as 1K
$('.num_1').text(Number($('.num_1').text())+1); or $('.num_1').text(Number($('.num_1').text())-1);
any help would be appreciated thanks
Comments
Comment posted by Mamun
if the number is above 1000, hence 1K, i want nothing to happen. all i have so far is this code which works for numbers under 1000 and not numbers abbbreviated as 1K?
Comment posted by Check if string contains only digits
Does this answer your question?
Comment posted by s.kuznetsov
you will also need to multiply the number by 1000, if there is a
Comment posted by Carsten Massmann
Translating the postfixes
Comment posted by Max Njoroge
@freedomn-m yes thanks that helps
Comment posted by Max Njoroge
decided to just update with AJAX instead, thank you