How to make the color of 0000 retained after the decimal is different from the non-zero number?

lastZero:function (num) {
    var reg = /0+$/;
    return reg.test(num)
  }

I wrote a rule, but I still think that the rule is just to determine whether the last number is 0

.

what I want is some data returned in the background. If the end of these numbers is 0, I will make the colors of these 000s different, like

below.

excuse me, how should this effect be achieved, whether it is in vue, is it possible to do it with a filter or other js code?

can you provide a sample code?


vue has not been used, but you can probably use 000 to deal with

.
function splitNum(numStr){
    var regex=/^(?=.*\.)([\d.]*?)(0+)$/;
    var result=numStr.match(regex);
    return result?(result[1]+","+result[2]):numStr;
}
function lastZero(numStr){
    var regex=/[^0](?=0+$)/;
    return numStr.indexOf(".")>=0?numStr.replace(regex,"$&,"):numStr;
}

regular can take out two parts of data at the same time


let str = "123.320000" ;

Number(str) //
// 123.32

str.length - String(Number(str)).length 0
//4

forgive me for forgetting the regular pattern.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3c0dd-4086d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3c0dd-4086d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?