Player12
An open source football management simulator
Loading...
Searching...
No Matches
Format Namespace Reference

Text formatting helpers shared by management screens. More...

Functions

std::string 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 thousands (int64_t value)
 Integer with thousands separators, e.g. "38,500" / "38.500".
 
std::string moneyFull (int64_t amount)
 Full currency with thousands separators, e.g. "€1,250,000"; Italian "€ 1.250.000".
 
std::string decimal (double value, int digits)
 Fixed decimals with the language's mark, e.g. "7.5" / "7,5".
 
std::string date (const GameDateValue &value)
 Localised short date, e.g. "12 Jul 2025".
 
std::string dayMonth (const GameDateValue &value)
 Localised short date without the year, e.g. "12 Jul".
 
const char * weekday (const GameDateValue &value)
 Localised short weekday, e.g. "Sun".
 
std::string kickoff (uint16_t minutes)
 Kick-off time (minutes after midnight), e.g. "20:45".
 
std::string matchDay (const GameDateValue &value, uint16_t kickoff_minutes)
 Weekday, short date and kick-off, e.g. "Sun 17 Aug 20:45".
 
const char * 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 signedInt (int value)
 Signed integer, e.g. "+4", "-2", "0".
 

Detailed Description

Text formatting helpers shared by management screens.

Function Documentation

◆ date()

std::string Format::date ( const GameDateValue &  value)

Localised short date, e.g. "12 Jul 2025".

◆ dayMonth()

std::string Format::dayMonth ( const GameDateValue &  value)

Localised short date without the year, e.g. "12 Jul".

◆ decimal()

std::string Format::decimal ( double  value,
int  digits 
)

Fixed decimals with the language's mark, e.g. "7.5" / "7,5".

◆ kickoff()

std::string Format::kickoff ( uint16_t  minutes)

Kick-off time (minutes after midnight), e.g. "20:45".

◆ matchDay()

std::string Format::matchDay ( const GameDateValue &  value,
uint16_t  kickoff_minutes 
)

Weekday, short date and kick-off, e.g. "Sun 17 Aug 20:45".

◆ money()

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".

◆ moneyFull()

std::string Format::moneyFull ( int64_t  amount)

Full currency with thousands separators, e.g. "€1,250,000"; Italian "€ 1.250.000".

◆ plural()

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.

◆ signedInt()

std::string Format::signedInt ( int  value)

Signed integer, e.g. "+4", "-2", "0".

◆ thousands()

std::string Format::thousands ( int64_t  value)

Integer with thousands separators, e.g. "38,500" / "38.500".

◆ weekday()

const char * Format::weekday ( const GameDateValue &  value)

Localised short weekday, e.g. "Sun".