SOURCE

console 命令行工具 X clear

                    
>
console
function zhDigitToArabic(t){t.startsWith("十")&&(t="一"+t);const e=["零","一","二","三","四","五","六","七","八","九"],n=["千","百","十"],r=["万","亿","兆","京","垓","秭","穰","沟","涧","正","载","极","恒河沙","阿僧祗","那由他","不可思议","无量","大数"];let i,o=0;for(let a=t.length-1;a>=0;a--)e.indexOf(t[a])>-1?o+=i?i*l(t[a]):l(t[a]):n.indexOf(t[a])>-1?(o+=i?i*c(t[a])*l(t[a-1]):c(t[a])*l(t[a-1]),--a):r.indexOf(t[a])>-1&&(n.indexOf(t[a-1])>-1?l(t[a-1])?o+=f(t[a])*l(t[a-1]):(o+=f(t[a])*c(t[a-1])*l(t[a-2]),i=f(t[a]),--a):(o+=f(t[a])*l(t[a-1]),i=f(t[a])),--a);return o;function l(t){for(let n=0;n<e.length;n++)if(e[n]===t)return n}function c(t){for(let e=n.length;e>0;e--)if(t===n[e-1])return Math.pow(10,4-e)}function f(t){for(let e=0;e<r.length;e++)if(t===r[e])return Math.pow(10,4*(e+1))}}new Vue({el:"#app",data:()=>({src:""}),computed:{tgt(){const t=this.src.replace(/[^0-9一二三四五六七八九十百千万亿兆]/g,".").replace(/([一二三四五六七八九十百千万亿兆])(\d)/g,"$1.$2").replace(/(\d)([一二三四五六七八九十百千万亿兆])/g,"$1.$2").split(".").filter(t=>t.length>0).map(t=>/^\d*$/.test(t)?Number(t):zhDigitToArabic(t)).filter(Boolean),e=[...new Set(t)].sort((t,e)=>t-e),n=e.map(t=>"");t.forEach(t=>{n[e.indexOf(t)]+="X"});const r=e.map((t,e)=>t+":\t"+n[e]);return r.sort((t,e)=>{const n=t.replace(/[^X]/g,"");return e.replace(/[^X]/g,"").length-n.length}),r.join("\n")}}});
<div id="app">
  <v-layout row wrap>
    <v-flex xs6>
    <v-card>
        <v-card-text>
        <v-textarea v-model="src" auto-grow filled label="源文本" rows="20"></v-textarea>
        </v-card-text>
    </v-card>
    </v-flex>
    <v-flex xs6>
    <v-card>
        <v-card-text>
        <v-textarea v-model="tgt" auto-grow filled label="统计结果" rows="20" disabled></v-textarea>
        </v-card-text>
    </v-card>
    </v-flex>
    </v-layout>
</div>

本项目引用的自定义外部资源