amaannawab923 commented on code in PR #36416:
URL: https://github.com/apache/superset/pull/36416#discussion_r2665775504
##########
superset-frontend/packages/superset-ui-core/src/currency-format/CurrencyFormatter.ts:
##########
@@ -41,6 +45,38 @@ export const getCurrencySymbol = (currency:
Partial<Currency>) =>
.formatToParts(1)
.find(x => x.type === 'currency')?.value;
+/** Normalize currency to ISO 4217 format (e.g., "USD"). Returns null if
invalid. */
+export function normalizeCurrency(
+ value: string | null | undefined,
+): string | null {
+ if (!value) return null;
+
+ const str = value.toString().trim();
Review Comment:
if the value is already string and we have handled a null check do we need
to do a toString
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]