mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-15 15:37:33 +08:00
add skewness and kurtosis to value metric in insights explorer
This commit is contained in:
@@ -81,8 +81,9 @@ import {
|
||||
|
||||
import { NumeralSystem, DecimalSeparator } from '@/core/numeral.ts';
|
||||
import type { CurrencyPrependAndAppendText } from '@/core/currency.ts';
|
||||
import { DEFAULT_DECIMAL_NUMBER_COUNT } from '@/consts/numeral.ts';
|
||||
import { DEFAULT_DECIMAL_NUMBER_COUNT, AMOUNT_FACTOR } from '@/consts/numeral.ts';
|
||||
import { TRANSACTION_MIN_AMOUNT, TRANSACTION_MAX_AMOUNT } from '@/consts/transaction.ts';
|
||||
|
||||
import { isNumber, replaceAll } from '@/lib/common.ts';
|
||||
import { evaluateExpressionToAmount } from '@/lib/evaluator.ts';
|
||||
import type { ComponentDensity, InputVariant } from '@/lib/ui/desktop.ts';
|
||||
@@ -297,7 +298,7 @@ function getFormattedValue(value: number): string {
|
||||
|
||||
function getDisplayCurrencyPrependAndAppendText(): CurrencyPrependAndAppendText | null {
|
||||
const numericCurrentValue = parseAmountFromLocalizedNumerals(currentValue.value);
|
||||
const isPlural = numericCurrentValue !== 100 && numericCurrentValue !== -100;
|
||||
const isPlural = numericCurrentValue !== AMOUNT_FACTOR && numericCurrentValue !== -AMOUNT_FACTOR;
|
||||
|
||||
return getAmountPrependAndAppendText(props.currency, isPlural);
|
||||
}
|
||||
|
||||
@@ -83,6 +83,7 @@ import { useI18n } from '@/locales/helpers.ts';
|
||||
import { useI18nUIComponents, isiOS } from '@/lib/ui/mobile.ts';
|
||||
|
||||
import { NumeralSystem } from '@/core/numeral.ts';
|
||||
import { AMOUNT_FACTOR } from '@/consts/numeral.ts';
|
||||
import { ALL_CURRENCIES } from '@/consts/currency.ts';
|
||||
import { isNumber } from '@/lib/common.ts';
|
||||
import logger from '@/lib/logger.ts';
|
||||
@@ -385,7 +386,7 @@ function confirm(): boolean {
|
||||
finalValue = previous - current;
|
||||
break;
|
||||
case '×':
|
||||
finalValue = Math.trunc(previous * current / 100);
|
||||
finalValue = Math.trunc(previous * current / AMOUNT_FACTOR);
|
||||
break;
|
||||
default:
|
||||
finalValue = previous;
|
||||
|
||||
Reference in New Issue
Block a user