Skip to content

Comments

Fix currency not showing as expected#37

Merged
technologic-technologic merged 1 commit intogen-aifrom
11-formatting-currencies
Oct 16, 2025
Merged

Fix currency not showing as expected#37
technologic-technologic merged 1 commit intogen-aifrom
11-formatting-currencies

Conversation

@technologic-technologic
Copy link
Owner

Created new CurrencyFormatter.ts util to format numbers and added render behavior to columns to implement currency formatter and properly display currencies.
More info below.

Created new CurrencyFormatter.ts util to format numbers, and added render behavior to columns to implement currency formatter and properly display currencies

Signed-off-by: Leonardo Trevizo <leonardo.trevizo@encora.com>
@github-actions
Copy link

PR Summary

WHAT Changed

  • Added Currency Formatter: Introduced a new utility function currencyTransformator in CurrencyFormatter.ts to format numbers as currency.
  • Updated Inventory Tables: Modified InventoryTable.tsx and InventoryMetricsTable.tsx to utilize currencyTransformator for rendering price values and overall stock values.

WHY It Matters

  • Improved User Experience: Enhances the readability of price-related data in the inventory tables by displaying them in a standardized currency format.
  • Consistency: Ensures that all monetary values are presented uniformly across different components.

RISKS

  • Rendering Issues: Potential for rendering issues if currencyTransformator does not handle unexpected input types or null values correctly.
  • Performance: Minor performance impact due to additional rendering logic, though likely negligible for typical use cases.

TESTS to Add

  • Unit Tests for Currency Formatter: Ensure that currencyTransformator correctly formats various numeric inputs, including edge cases like null or undefined.
  • Integration Tests for Tables: Verify that the inventory tables render correctly with formatted currency values.

BREAKING CHANGES

  • None: No breaking changes introduced; existing functionality remains intact.

Changed File Paths

  • inventory-manager/src/components/page-content/segment3-table/segment/InventoryTable.tsx
  • inventory-manager/src/components/page-content/segment4-metrics/InventoryMetricsTable.tsx
  • inventory-manager/src/utils/CurrencyFormatter.ts (new file)

@technologic-technologic technologic-technologic linked an issue Oct 16, 2025 that may be closed by this pull request
@technologic-technologic technologic-technologic added this to the Major fixes milestone Oct 16, 2025
@technologic-technologic technologic-technologic added bug Something isn't working enhancement New feature or request labels Oct 16, 2025
@technologic-technologic technologic-technologic merged commit 786657b into gen-ai Oct 16, 2025
1 check passed
@technologic-technologic technologic-technologic deleted the 11-formatting-currencies branch October 16, 2025 01:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Formatting

1 participant