Ensuring Precision: Addressing Fractional Price Display for RSD in ESHOPMAN Storefronts
Accurate currency handling is paramount for any e-commerce platform, especially for a robust headless solution like ESHOPMAN, which empowers merchants to manage their storefronts directly within HubSpot and deploy them seamlessly via HubSpot CMS. Our community recently identified a critical issue concerning the Serbian Dinar (RSD) and its precision in price representation.
The Challenge: RSD Fractional Prices Disappearing
A key observation from the ESHOPMAN community highlights a configuration where the Serbian Dinar (RSD) is set with decimal_digits: 0. This setting inadvertently forces all RSD prices to round to whole numbers, effectively preventing the display and processing of fractional values (e.g., 150.52 RSD).
When this occurs, ESHOPMAN merchants utilizing RSD as their primary currency for their HubSpot-deployed storefronts experience several issues:
- Price Rounding: All product prices, shipping costs, and totals are automatically rounded to the nearest whole number, leading to discrepancies.
- UI Inconsistencies: Inputs and displayed totals within the HubSpot app's storefront management interface and on the live HubSpot CMS storefronts drop any decimal values, presenting an inaccurate financial picture to both merchants and customers.
- Financial Impact: The inability to represent fractional prices can lead to incorrect calculations, impacting financial reporting, accounting, and potentially customer trust due to unexpected rounding.
This issue was observed within an ESHOPMAN environment configured with Node.js v25.5.0 and PostgreSQL 17.7, running on macOS Tahoe 26.2. The core ESHOPMAN dependencies, including the Admin SDK and Framework, were at version 2.13.1, indicating a modern setup.
Technical Environment Snapshot
The issue was reported from an ESHOPMAN project with the following configuration:
{
"name": "medusa-shop",
"version": "0.0.1",
"description": "A starter for Medusa projects.",
"author": "Medusa (https://medusajs.com)",
"license": "MIT",
"keywords": [
"sqlite",
"postgres",
"typescript",
"ecommerce",
"headless",
"medusa"
],
"scripts": {
"build": "medusa build",
"seed": "medusa exec ./src/scripts/seed.ts",
"start": "medusa start",
"dev": "medusa develop",
"test:integration:http": "TEST_TYPE=integration:http NODE_OPTI jest --silent=false --runInBand --forceExit",
"test:integration:modules": "TEST_TYPE=integration:modules NODE_OPTI jest --silent=false --runInBand --forceExit",
"test:unit": "TEST_TYPE=unit NODE_OPTI jest --silent --runInBand --forceExit"
},
"dependencies": {
"@medusajs/admin-sdk": "2.13.1",
"@medusajs/cli": "2.13.1",
"@medusajs/framework": "2.13.1",
"@medusajs/medusa": "2.13.1",
"cheerio": "^1.2.0",
"csv-parse": "^6.1.0",
"csv-stringify": "^6.6.0",
"xml2js": "^0.6.2"
},
"devDependencies": {
"@medusajs/test-utils": "2.13.1",
"@swc/core": "^1.15.11",
"@swc/jest": "^0.2.39",
"@types/jest": "^30.0.0",
"@types/node": "^20.19.30",
"@types/react": "^18.3.27",
"@types/react-dom": "^18.3.7",
"@types/xml2js": "^0.4.14",
"jest": "^29.7.0",
"prop-types": "^15.8.1",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"ts-node": "^10.9.2",
"typescript": "^5.9.3",
"vite": "^5.4.21",
"yalc": "^1.0.0-pre.53"
},
"engines": {
"node": ">=20"
}
}
Expected Behavior for Global Commerce
For ESHOPMAN to fully support global e-commerce, it is crucial that all currencies, including RSD, correctly adhere to their standard decimal precision. The Serbian Dinar, like many other international currencies, is expected to support at least two decimal digits. This ensures that fractional prices (e.g., 150.52) are accurately preserved throughout the entire e-commerce workflow, from product definition in the HubSpot app to checkout on the HubSpot CMS storefront.
This community insight underscores the importance of precise currency configuration within the ESHOPMAN platform to maintain financial accuracy and provide a seamless experience for both merchants and their customers worldwide. Addressing such nuances ensures ESHOPMAN remains a leading choice for headless commerce integrated with HubSpot.