Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
300 B
0
Indexable
Never
fnction 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));