Skip to content

Price field always shows "USD" instead of the server's configured currency #246

Description

@ilrak58

When purchasing/scanning a product (PurchaseProductView), the price field always displays the currency code "USD", regardless of the currency configured on the Grocy server (e.g. CURRENCY=EUR).

Steps to reproduce:

  1. Set up a Grocy server with CURRENCY=EUR (confirmed correct via the web frontend, which shows "€" properly)
  2. Open the app, go to Purchase for any product
  3. The "Price" field shows e.g. "1,00 USD" instead of "1,00 EUR" / "1,00 €"

Root cause:
Grocy Mobile/Helper/CurrencySymbol.swift is hardcoded:

func getCurrencySymbol() -> String {
    return "USD"
}

This is called directly in PurchaseProductView.swift (line 228):

MyDoubleStepperOptional(..., currencySymbol: getCurrencySymbol())

Meanwhile, SystemConfigModel.swift already correctly decodes the server's actual currency into SystemConfig.currency (from the CURRENCY config key), and it's used correctly elsewhere, e.g. via grocyVM.getFormattedCurrency(...) in the same file (line 231).

Suggested fix:
Replace the hardcoded stub with the actual value from the fetched system config, e.g. something like grocyVM.systemConfig?.currency ?? "USD", instead of the hardcoded "USD" literal — consistent with how getFormattedCurrency already does it.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions