api ulangan

This commit is contained in:
Samandar Turgunboyev
2025-12-22 19:03:57 +05:00
parent fd397b670b
commit 7f2fe3868b
121 changed files with 12636 additions and 5528 deletions

View File

@@ -1,5 +1,5 @@
import i18n from '@/shared/config/i18n';
import { LanguageRoutes } from '@/shared/config/i18n/type';
import i18n from "@/shared/config/i18n";
import { LanguageRoutes } from "@/shared/config/i18n/type";
/**
* Format price. With label.
@@ -10,20 +10,20 @@ import { LanguageRoutes } from '@/shared/config/i18n/type';
const formatPrice = (amount: number | string, withLabel?: boolean) => {
const locale = i18n.language;
const label = withLabel
? locale == LanguageRoutes.RU
? ' сум'
: locale == LanguageRoutes.KI
? ' сўм'
: ' som'
: '';
const parts = String(amount).split('.');
? locale === LanguageRoutes.RU
? " сум"
: locale === LanguageRoutes.KI
? " сўм"
: " som"
: "";
const parts = String(amount).split(".");
const dollars = parts[0];
const cents = parts.length > 1 ? parts[1] : '00';
const cents = parts.length > 1 ? parts[1] : "00";
const formattedDollars = dollars.replace(/\B(?=(\d{3})+(?!\d))/g, ' ');
const formattedDollars = dollars.replace(/\B(?=(\d{3})+(?!\d))/g, " ");
if (String(amount).length == 0) {
return formattedDollars + '.' + cents + label;
if (String(amount).length === 0) {
return formattedDollars + "." + cents + label;
} else {
return formattedDollars + label;
}