Report Number Localiser
MQL4's own formatting functions have no locale concept at all: DoubleToString always uses "." as the decimal point and never groups thousands digits, and TimeToString always prints dates as yyyy.mm.dd. That is the wrong convention for a huge share of the world's readers - a European report needs "1.234,56" and "07.03.2026", not "1234.56" and "2026.03.07" - and there is no built-in locale API in MQL4 to fall back on. This header re-groups the digits and swaps separators by hand for four built-in locales: US (1,234.56 / MM/DD/YYYY), EU (1.234,56 / DD.MM.YYYY), UK (1,234.56 / DD/MM/YYYY), and ISO (1234.56, no grouping / YYYY-MM-DD). RnlFormatNumber handles the sign, digit grouping and decimal separator; RnlFormatDate/RnlFormatDateTime handle the date field order; RnlFormatCurrency wraps RnlFormatNumber with a currency symbol placed before or after the amount, since symbol placement itself is a locale convention traders expect respected in an exported report. Notes and limitations Covers four built-in locales only (US, EU, UK, ISO) - not a full locale database, and adding a fifth means editing the header's switch statements directly rather than passing a new parameter. Digit grouping is always in threes (the near-universal convention); locales that group differently (e.g. the Indian numbering system's 2-digit groups above the first three) are not supported. Currency formatting places a single space between the symbol and the amount and applies no per-currency symbol table - the caller supplies the symbol text itself. Time-of-day formatting is always 24-hour HH:MM:SS with no am/pm variant, since MQL4 gives no locale signal for which a report should use.
Script · MT4 · v1.0 · Free
About Report Number Localiser
Report Number Localiser is a script for MetaTrader 4. It has 2 settings, such as Sample amount and Decimals. MQL source code included.
Files in the download: ReportNumberLocaliser.mqh, ReportNumberLocaliser.txt, ReportNumberLocaliserDemo.mq4.
Settings
| Setting | Default | What it does |
|---|---|---|
| Sample amount | -1234567.891 | sample value formatted in every locale |
| Decimals | 2 | decimal places to display |
How to install
- Download the ZIP from your PolyMaria library and unzip it.
- In MetaTrader 4 open File → Open Data Folder, then go to MQL4 → Scripts.
- Copy the .mq4 file(s) there. Put any .mqh files in MQL4 → Include.
- Open the .mq4 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
- Drag the script onto a chart to run it once.
Tags: Risk & Lot Size · MT4 Script · MQL4 Source Code