# vue插值语法使用公共函数

@/utlis/index.js

```//格式化数据
export function formatPlayCount(number) {
let stringNumber = number.toString();
let numberLength = stringNumber.length;
//亿级别
if (numberLength > 8) {
return parseInt(number / 100000000) + "亿";
}
// 万级别
else if (numberLength > 4) {
return parseInt(number / 10000) + "万";
} else {
return number;
}
}```

`import {formatPlayCount} from "@/utils/index.js"`

`<span>{{ formatPlayCount(originalData) }}</span>`

```computed:{
formatPlayCount() {
return (originalData) => {
return formatPlayCount(originalData);
};
},
}```
{"ft_lang_label":"__label__zh","ft_lang_prob":0.685085,"math_prob":0.9716238,"size":818,"snap":"2021-21-2021-25","text_gpt3_token_len":394,"char_repetition_ratio":0.15233415,"word_repetition_ratio":0.0,"special_character_ratio":0.25794622,"punctuation_ratio":0.16304348,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9722955,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2021-06-22T20:59:18Z\",\"WARC-Record-ID\":\"<urn:uuid:e1fb659a-dade-4320-bd9b-97ea88c22ff4>\",\"Content-Length\":\"25100\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:9aee6c88-23ca-4e5e-a816-a056b830817f>\",\"WARC-Concurrent-To\":\"<urn:uuid:9d7a19b3-6319-4269-9206-7005cdc9065e>\",\"WARC-IP-Address\":\"121.199.58.172\",\"WARC-Target-URI\":\"https://chaihongjun.me/javascript/319.html\",\"WARC-Payload-Digest\":\"sha1:4AYZ3WGXF7USX7UFB4UOEBFYWW2MVXFX\",\"WARC-Block-Digest\":\"sha1:NHH4BFP72JEQ3RCK75J6UQZR3KKRAZZQ\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2021/CC-MAIN-2021-25/CC-MAIN-2021-25_segments_1623488519735.70_warc_CC-MAIN-20210622190124-20210622220124-00177.warc.gz\"}"}