fix(salary): use median monthly salary (robust to bonus/outlier months)
Full-history check found one work month with a stray 3rd installment (₮5.77M) skewing latest-complete and the mean. Switch the monthly-salary figure (income card + safe-to-spend) to the median of fully-paid work months (₮3.83M here), robust to that outlier. Card now shows a 'сарын дундаж ~₮X' caption under salary.
This commit is contained in:
parent
741d5ca0f4
commit
55b2bf61a5
2 changed files with 7 additions and 0 deletions
|
|
@ -252,6 +252,7 @@ function IncomeRow({ label, value, dotColor, loading, hidden }: { label: string;
|
|||
function IncomeCard({ month, loading, hidden }: { month?: Analyze; loading: boolean; hidden: boolean }) {
|
||||
const salary = dec(month?.salaryIncome);
|
||||
const support = dec(month?.otherIncome);
|
||||
const typical = dec(month?.monthlySalary);
|
||||
const income = dec(month?.income);
|
||||
const expense = dec(month?.expense);
|
||||
const saved = income - expense;
|
||||
|
|
@ -265,6 +266,11 @@ function IncomeCard({ month, loading, hidden }: { month?: Analyze; loading: bool
|
|||
<SectionHeader title={s.incomeTitle} />
|
||||
<div style={{ display: "flex", flexDirection: "column", gap: 10 }}>
|
||||
<IncomeRow label={s.incomeSalary} value={salary} dotColor={good} loading={loading} hidden={hidden} />
|
||||
{!loading && typical > 0 && (
|
||||
<div style={{ fontSize: 12, color: "var(--seed-color-fg-neutral-muted, #8b8b8b)", marginTop: -6, marginLeft: 18 }}>
|
||||
{s.incomeTypical} {hidden ? MASKED : tugrikShortRaw(typical)}
|
||||
</div>
|
||||
)}
|
||||
<IncomeRow label={s.incomeSupport} value={support} dotColor="var(--mercury-brand-yellow, #f2b021)" loading={loading} hidden={hidden} />
|
||||
</div>
|
||||
<div>
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ export const homeStrings = {
|
|||
// Income card — earned salary vs support, and what's kept.
|
||||
incomeTitle: "Энэ сарын орлого",
|
||||
incomeSalary: "Цалин",
|
||||
incomeTypical: "сарын дундаж",
|
||||
incomeSupport: "Дэмжлэг ба бусад",
|
||||
incomeSaved: "Хэмнэсэн",
|
||||
incomeSpentOf: "зарцуулсан",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue