Player12
An open source football management simulator
Loading...
Searching...
No Matches
format.h
Go to the documentation of this file.
1// -----------------------------------------------------------------------------
2// Football Management Project
3// Copyright (c) 2025 - 2026 Flavio Milinanni. All Rights Reserved.
4//
5// This file is part of the Football Management Project.
6// See the LICENSE file in the project root.
7// -----------------------------------------------------------------------------
8
9#pragma once
10
11#include <cstdint>
12#include <string>
13
14#include "model/gamedate.h"
15
19namespace Format
20{
21
26std::string money(int64_t amount);
27
32std::string moneyFull(int64_t amount);
33
35std::string thousands(int64_t value);
36
38std::string decimal(double value, int digits);
39
41std::string date(const GameDateValue& value);
42
44std::string dayMonth(const GameDateValue& value);
45
47const char* weekday(const GameDateValue& value);
48
50std::string kickoff(uint16_t minutes);
51
53std::string matchDay(const GameDateValue& value, uint16_t kickoff_minutes);
54
59const char* plural(const char* key, int64_t count);
60
62std::string signedInt(int value);
63
64} // namespace Format
ImGuiKey key
Definition input_actions.cpp:25
Text formatting helpers shared by management screens.
Definition format.cpp:33
std::string dayMonth(const GameDateValue &value)
Localised short date without the year, e.g. "12 Jul".
Definition format.cpp:54
std::string signedInt(int value)
Signed integer, e.g. "+4", "-2", "0".
Definition format.cpp:89
std::string money(int64_t amount)
Compact currency in the current language, e.g. "€12.4M", "€850K", "-€3.1M"; Italian "€ 12,...
Definition format.cpp:35
std::string moneyFull(int64_t amount)
Full currency with thousands separators, e.g. "€1,250,000"; Italian "€ 1.250.000".
Definition format.cpp:39
std::string matchDay(const GameDateValue &value, uint16_t kickoff_minutes)
Weekday, short date and kick-off, e.g. "Sun 17 Aug 20:45".
Definition format.cpp:73
const char * weekday(const GameDateValue &value)
Localised short weekday, e.g. "Sun".
Definition format.cpp:59
std::string kickoff(uint16_t minutes)
Kick-off time (minutes after midnight), e.g. "20:45".
Definition format.cpp:68
std::string decimal(double value, int digits)
Fixed decimals with the language's mark, e.g. "7.5" / "7,5".
Definition format.cpp:44
std::string date(const GameDateValue &value)
Localised short date, e.g. "12 Jul 2025".
Definition format.cpp:49
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,...
Definition format.cpp:79
std::string thousands(int64_t value)
Integer with thousands separators, e.g. "38,500" / "38.500".
Definition format.cpp:37
Represents a specific date in the game world.
Definition gamedate.h:20