Files
gold_land_user/src/modules/gold-land/lesson/growthTable.ts
T
safavimohadeseh78andCursor c53a67831d
Frontend CI / unit (test, type-check, build) (push) Successful in 7m21s
Frontend CI / browser E2E (frontend + pinned backend) (push) Successful in 11m38s
feat: complete the thirteen-stage learning experience and E2E journey
Play levels 7-13 in the app and pin E2E to the local thirteen-stage backend commit.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-22 19:42:04 +03:30

22 lines
727 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
const PERSIAN_DIGITS = '۰۱۲۳۴۵۶۷۸۹'
export function formatCoinTenths(tenths: number): string {
const abs = Math.abs(Math.trunc(tenths))
const whole = Math.floor(abs / 10)
const fraction = abs % 10
const plain = fraction === 0 ? String(whole) : `${whole}.${fraction}`
return plain.replace(/\d/g, (digit) => PERSIAN_DIGITS[Number(digit)] ?? digit).replace('.', '٫')
}
export function revealPeriods<T>(periods: T[], shown: number): T[] {
return periods.slice(0, Math.max(0, Math.min(shown, periods.length)))
}
export function nextShown(shown: number, total: number): number {
return Math.min(total, shown + 1)
}
export function previousShown(shown: number): number {
return Math.max(1, shown - 1)
}