mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-20 01:34:24 +08:00
modify bar chart style
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
export default function (value, precision, lowPrecisionValue) {
|
||||
const ratio = Math.pow(10, precision);
|
||||
const normalizedValue = Math.floor(value * ratio);
|
||||
|
||||
if (value > 0 && normalizedValue < 1 && lowPrecisionValue) {
|
||||
return lowPrecisionValue + '%';
|
||||
}
|
||||
|
||||
const result = normalizedValue / ratio;
|
||||
return result + '%';
|
||||
}
|
||||
Reference in New Issue
Block a user