|
@@ -1,5 +1,9 @@
|
|
|
<template>
|
|
|
- <span :style="{ fontSize: amount_font_size + 'px' }">{{ amount }}</span>
|
|
|
+ <span :style="{ fontSize: amount_font_size + 'px' }">
|
|
|
+ <a-tooltip :title="amount">
|
|
|
+ {{ getBit(amount) }}
|
|
|
+ </a-tooltip>
|
|
|
+ </span>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
@@ -47,6 +51,16 @@ export default {
|
|
|
setFontSize() {
|
|
|
let _num = parseInt(this.width / this.amount.length);
|
|
|
this.amount_font_size = _num < this.fontSize ? _num : this.fontSize;
|
|
|
+ },
|
|
|
+ getBit (value) {
|
|
|
+ const reg = /([0-9]+\.[0-9]{4})[0-9]*/;
|
|
|
+ if(value) {
|
|
|
+ let str = value.toString();
|
|
|
+ str = str.replace(reg,"$1");
|
|
|
+ return str;
|
|
|
+ } else {
|
|
|
+ return value;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|