当前位置:网站首页>Display Chinese characters according to numbers
Display Chinese characters according to numbers
2022-07-04 08:15:00 【Э Time walker to me】
Display Chinese characters according to numbers

<div class="money">
<div class="left">
<span> total </span>
<br>
<span> amount of money </span>
</div>
<div class="nums">
<span class="unit">{
{payDetail.moneyArr[0]}} Thousand </span>
<span class="unit">{
{payDetail.moneyArr[1]}} Bai </span>
<span class="unit">{
{payDetail.moneyArr[2]}} Ten </span>
<span class="unit">{
{payDetail.moneyArr[3]}} ten thousand </span>
<span class="unit">{
{payDetail.moneyArr[4]}} Thousand </span>
<span class="unit">{
{payDetail.moneyArr[5]}} Bai </span>
<span class="unit">{
{payDetail.moneyArr[6]}} Ten </span>
<span class="unit">{
{payDetail.moneyArr[7]}} element </span>
<span class="unit">{
{payDetail.moneyArr[8]}} horn </span>
<span class="unit">{
{payDetail.moneyArr[9]}} branch </span>
</div>
<div class="right">
¥<span class="underline">{
{Number(payDetail.payAmount||0).toFixed(2)}}</span> element
</div>
</div>
data() {
return {
modalShow: false,
id: '',
payDetail: {
paymentOrderNo: '', // Payment request No
payAmount: '', // Amount due
accountName: '', // title of account
bank: '', // Bank of deposit
accountNumber: '', // Bank account
billDateStart: '', // Bill start time
billDateEnd: '', // Bill end time
applyTime: '', // Application time
applicant: '', // Applicant
settlementType: '', // Settlement method
remarks: '', // remarks
moneyArr: []
}
}
},
created() {
console.log(this.$route.query)
this.init()
},
methods: {
async init() {
let id = this.$route.query.id
if (!id) return
this.$Spin.show()
try {
let res = await getPaymentOrder({
id })
this.payDetail = res.data.result || {
}
this.payDetail.moneyArr = this.convertCurrency(Number(this.payDetail.payAmount)) // This is the value we use
} catch (error) {
console.log(error)
this.$Message.error(' Network anomalies ')
} finally {
this.$Spin.hide()
}
},
convertCurrency(money) {
console.log(this.payDetail.payAmount) // egg:123456 Numeric type
// The number of Chinese characters
var cnNums = [' zero ', ' one ', ' Ii. ', ' 3 ', ' boss ', ' wu ', ' lu ', ' Retailer, ', ' ', ' nine ']
// Maximum processed number
var maxNum = 99999999999999.99
// Array used after separating amounts , predefined
if (!money) {
return '' }
money = parseFloat(money)
if (money >= maxNum) {
// Maximum processing number exceeded
return ''
}
// Convert to string
money = Number(money).toFixed(2)
let arr = Array.from(money).filter(item => item !== '.').map(item => cnNums[item])
console.log(arr)
let len = arr.length
if (len < 10) {
for (let i = 0; i < 10 - len; i++) {
arr.unshift(' zero ')
}
}
console.log(arr) // This one can print out the Chinese numerical value
return arr
},
// Print
doPrint() {
window.print()
}
}
边栏推荐
- 谷歌官方回应:我们没有放弃TensorFlow,未来与JAX并肩发展
- 【性能测试】一文读懂Jmeter
- 线性代数1.1
- L1-024 the day after tomorrow (5 points)
- Is l1-029 too fat (5 points)
- Cannot click button when method is running - C #
- [untitled] 2022 polymerization process analysis and polymerization process simulation examination
- C # implements a queue in which everything can be sorted
- Redis sentinel mechanism
- L1-022 odd even split (10 points)
猜你喜欢

Conversion of yolov5 XML dataset to VOC dataset

DM8 tablespace backup and recovery

【性能測試】一文讀懂Jmeter

Question 49: how to quickly determine the impact of IO latency on MySQL performance

Devops Practice Guide - reading notes (long text alarm)

Fault analysis | MySQL: unique key constraint failure

Redis sentinel mechanism

Moher College webmin unauthenticated remote code execution

Famous blackmail software stops operation and releases decryption keys. Most hospital IOT devices have security vulnerabilities | global network security hotspot on February 14
![[go basics] 1 - go go](/img/e2/d973b9fc9749e1c4755ce7d0ec11a1.png)
[go basics] 1 - go go
随机推荐
Flask 常用组件
Sqli labs download, installation and reset of SQL injection test tool one of the solutions to the database error (# 0{main}throw in d:\software\phpstudy_pro\www\sqli labs-...)
Activiti常见操作数据表关系
Leetcode 146. LRU 缓存
DM8 database recovery based on point in time
[go basics] 2 - go basic sentences
JVM中堆概念
WordPress get_ Users() returns all users with comparison queries - PHP
【Go基础】1 - Go Go Go
Activiti common operation data table relationship
zabbix监控系统自定义监控内容
Learn nuxt js
Chrome is set to pure black
Système de surveillance zabbix contenu de surveillance personnalisé
What determines vacuum permittivity and vacuum permeability? Why do these two physical quantities exist?
es6总结
1、卡尔曼滤波-最佳的线性滤波器
Mouse over to change the transparency of web page image
Unity write word
Comprendre la méthode de détection des valeurs aberrantes des données