Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
301 B
0
Indexable
Never
function convert(value)
{
    if(value>=1000000)
    {
        value=(value/1000000)+"M"
    }
    else if(value>=1000)
    {
        value=(value/1000)+"K";
    }
    return value;
}
console.log(convert(1000));
console.log(convert(10000));
console.log(convert(300000));
console.log(convert(3000000));