Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Per Diem - Decimal Changing to Comma in Imported Sheet Preview When Switching to Spanish #56618

Merged
merged 2 commits into from
Feb 13, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/pages/workspace/perDiem/WorkspacePerDiemDetailsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ import ScreenWrapper from '@components/ScreenWrapper';
import ScrollView from '@components/ScrollView';
import useLocalize from '@hooks/useLocalize';
import useThemeStyles from '@hooks/useThemeStyles';
import {convertToFrontendAmountAsString, getCurrencySymbol} from '@libs/CurrencyUtils';
import {convertToDisplayStringWithoutCurrency, getCurrencySymbol} from '@libs/CurrencyUtils';
import Navigation from '@libs/Navigation/Navigation';
import type {PlatformStackScreenProps} from '@libs/Navigation/PlatformStackNavigation/types';
import {getPerDiemCustomUnit} from '@libs/PolicyUtils';
import type {SettingsNavigatorParamList} from '@navigation/types';
import AccessOrNotFoundWrapper from '@pages/workspace/AccessOrNotFoundWrapper';
import * as PerDiem from '@userActions/Policy/PerDiem';
import {deleteWorkspacePerDiemRates} from '@userActions/Policy/PerDiem';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
import ROUTES from '@src/ROUTES';
Expand All @@ -40,13 +40,13 @@ function WorkspacePerDiemDetailsPage({route}: WorkspacePerDiemDetailsPageProps)
const selectedRate = customUnit?.rates?.[rateID];
const selectedSubRate = selectedRate?.subRates?.find((subRate) => subRate.id === subRateID);

const amountValue = selectedSubRate?.rate ? convertToFrontendAmountAsString(Number(selectedSubRate.rate)) : undefined;
const amountValue = selectedSubRate?.rate ? convertToDisplayStringWithoutCurrency(Number(selectedSubRate.rate), selectedRate?.currency) : undefined;
const currencyValue = selectedRate?.currency ? `${selectedRate.currency} - ${getCurrencySymbol(selectedRate.currency)}` : undefined;

const FullPageBlockingView = isEmptyObject(selectedSubRate) ? FullPageOfflineBlockingView : View;

const handleDeletePerDiemRate = () => {
PerDiem.deleteWorkspacePerDiemRates(policyID, customUnit, [
deleteWorkspacePerDiemRates(policyID, customUnit, [
{
destination: selectedRate?.name ?? '',
subRateName: selectedSubRate?.name ?? '',
Expand Down