Turkey-connected projects · Remote development from the United States
Faith Forge LabsTurkey

Separate the entered amount from its Turkish display

An amount can look familiar to a customer while being interpreted incorrectly by a calculation or connected system. The risk appears when a formatted string is treated as though it were already an agreed numeric value. A currency symbol or a comma does not supply the missing input contract.

The worked quotation below is fictional. It illustrates technical review choices, not a price, tax treatment, provider recommendation or statement about what a particular merchant may sell.

Write down the intended value first

Suppose an offer contains seven items at 1,250.50 TRY each. The intended unit amount is one thousand two hundred fifty lira and fifty kuruş, and the simple line amount is 8,753.50 TRY before any separately defined adjustments. In a Turkish-style numeric display, the unit value can appear as “1.250,50” and the line value as “8.753,50”.

The stored amount, the currency and the displayed string serve different purposes. Use an explicit currency code where it prevents ambiguity. A user interface can format an agreed value for its audience; it should not ask the next system to recover that value by guessing which separator is decimal.

The ECMAScript internationalisation specification provides locale-sensitive number-formatting facilities. Formatting is not a general-purpose parser for arbitrary user-entered text. The project's input rules and actual provider contract still need to be defined.

Decide what the field accepts

If a person enters an amount manually, specify the expected format and give a useful example near the field. Decide whether grouping separators are allowed, how many fractional digits the task permits and what happens with an ambiguous value. Review the same rule on the client and server rather than relying only on a visual hint.

For our example, “1.250,50” might be valid under the deliberately chosen Turkish input rule. “1,250.50” belongs to a different convention. A parser that simply removes every comma would turn the first string into something other than the intended amount; a parser that reads only the initial numeric prefix can fail differently. Silent acceptance is worse than a clear correction when the result changes the commercial value.

Avoid an indiscriminate punctuation replacement. A field may receive pasted currency text, unexpected spacing or a value with too many fractional digits. Decide which cases can be accepted unambiguously and which require the person to correct the entry. Preserve the person's work and explain the problem without performing an unexplained financial reinterpretation.

Test the calculation separately

Once the value is parsed under the agreed rule, calculate using an appropriate numeric representation and explicit precision. The simple example is seven multiplied by 1,250.50, giving 8,753.50. In an integer representation using hundredths for this particular example, that is 7 × 125050 = 875350. Those numbers describe the example's scale; they are not a claim that every currency or provider uses the same minor-unit convention.

Decimal arithmetic facilities, such as those documented in Python's decimal module, can support explicit decimal calculations. The business still needs to decide where rounding occurs and how adjustments apply. A tool cannot infer whether a discount applies to each unit, the line or the final order.

Add a deliberately awkward test only after its rule is agreed. For instance, if a percentage adjustment produces more fractional digits, specify whether the approved calculation rounds at the line or total stage. Your commercial and finance reviewers determine the appropriate treatment. Do not present an arbitrary demonstration rule as a Turkish tax requirement.

Carry currency and version into the next system

A quotation revision should preserve the amount and currency associated with the decision. If the unit value changes after a customer has seen the offer, an older open page must not silently submit a decision about the new total. The quotation workflow service explains why the version belongs in that record.

For a payment or accounting connection, confirm the provider's expected representation, currency support and actual account capability. It may require a structured decimal string or a defined scaled integer; use the documented contract for that operation. A formatted display string is not automatically suitable API input.

Keep a customer response, an internal order release and a provider-confirmed payment as separate events where the process distinguishes them. A redirect or a success-looking browser screen should not be the only evidence of a financial result. The supported confirmation and reconciliation mechanism must be established for the actual provider.

Review the rest of the form by purpose

Do not collect a full billing profile simply because a person asks whether a product is suitable. Determine what the first decision needs and what can be requested later. Optional references should remain optional unless the business has a clear reason to require them. Names and addresses should be tested with representative approved examples rather than assumptions based on an English-only form.

The correction path matters. A person who fixes an amount should not lose the rest of a long enquiry. Staff should see the parsed value and enough context to understand the request. Logs should support diagnosis without becoming an unnecessary duplicate of private commercial information.

Make acceptance observable

Use a small set containing the valid example, the other separator convention, an ambiguous entry, an empty required field and a permitted correction. Follow the accepted value into the stored record and any included export. Compare the displayed amount, numeric value, currency and quotation version at each boundary.

Record the approved rule and the limitations in the handover. Specialist questions about tax, commerce obligations and provider eligibility remain with the appropriate reviewers; the references page points to official starting material. Discuss the form or transfer that is causing uncertainty with a fictional value and the expected result.