Player12
An open source football management simulator
Loading...
Searching...
No Matches
format.h File Reference
#include <cstdint>
#include <string>
#include "model/gamedate.h"

Go to the source code of this file.

Namespaces

namespace  Format
 Text formatting helpers shared by management screens.
 

Functions

std::string Format::money (int64_t amount)
 Compact currency in the current language, e.g. "€12.4M", "€850K", "-€3.1M"; Italian "€ 12,4 mln", "€ 850 mila".
 
std::string Format::moneyFull (int64_t amount)
 Full currency with thousands separators, e.g. "€1,250,000"; Italian "€ 1.250.000".
 
std::string Format::thousands (int64_t value)
 Integer with thousands separators, e.g. "38,500" / "38.500".
 
std::string Format::decimal (double value, int digits)
 Fixed decimals with the language's mark, e.g. "7.5" / "7,5".
 
std::string Format::date (const GameDateValue &value)
 Localised short date, e.g. "12 Jul 2025".
 
std::string Format::dayMonth (const GameDateValue &value)
 Localised short date without the year, e.g. "12 Jul".
 
const char * Format::weekday (const GameDateValue &value)
 Localised short weekday, e.g. "Sun".
 
std::string Format::kickoff (uint16_t minutes)
 Kick-off time (minutes after midnight), e.g. "20:45".
 
std::string Format::matchDay (const GameDateValue &value, uint16_t kickoff_minutes)
 Weekday, short date and kick-off, e.g. "Sun 17 Aug 20:45".
 
const char * Format::plural (const char *key, int64_t count)
 Localised pattern for a count: KEY_ONE when count is 1 and such a translation exists, otherwise KEY. Avoids "1 days" style texts.
 
std::string Format::signedInt (int value)
 Signed integer, e.g. "+4", "-2", "0".