KCoreAddons

formats.cpp
1/*
2 SPDX-FileCopyrightText: 2014 Bhushan Shah <bhush94@gmail.com>
3
4 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
5*/
6
7#include "formats.h"
8
9QString Formats::formatByteSize(double size, int precision) const
10{
11 return m_format.formatByteSize(size, precision);
12}
13
14QString Formats::formatDuration(quint64 msecs, KFormat::DurationFormatOptions options) const
15{
16 return m_format.formatDuration(msecs, options);
17}
18
19QString Formats::formatDecimalDuration(quint64 msecs, int decimalPlaces) const
20{
21 return m_format.formatDecimalDuration(msecs, decimalPlaces);
22}
23
24QString Formats::formatSpelloutDuration(quint64 msecs) const
25{
26 return m_format.formatSpelloutDuration(msecs);
27}
28
29QString Formats::formatRelativeDate(const QDate &date, QLocale::FormatType format) const
30{
31 return m_format.formatRelativeDate(date, format);
32}
33
34QString Formats::formatRelativeDateTime(const QDateTime &dateTime, QLocale::FormatType format) const
35{
36 return m_format.formatRelativeDateTime(dateTime, format);
37}
38
39#include "moc_formats.cpp"
QString formatByteSize(double size, int precision=1, KFormat::BinaryUnitDialect dialect=KFormat::DefaultBinaryDialect, KFormat::BinarySizeUnits units=KFormat::DefaultBinaryUnits) const
Converts size from bytes to the appropriate string representation using the binary unit dialect diale...
Definition kformat.cpp:34
QString formatRelativeDateTime(const QDateTime &dateTime, QLocale::FormatType format) const
Returns a string formatted to a relative datetime style.
Definition kformat.cpp:75
QString formatDecimalDuration(quint64 msecs, int decimalPlaces=2) const
Given a number of milliseconds, converts that to a string containing the localized equivalent to the ...
Definition kformat.cpp:60
QString formatSpelloutDuration(quint64 msecs) const
Given a number of milliseconds, converts that to a spell-out string containing the localized equivale...
Definition kformat.cpp:65
QString formatDuration(quint64 msecs, KFormat::DurationFormatOptions options=KFormat::DefaultDuration) const
Given a number of milliseconds, converts that to a string containing the localized equivalent,...
Definition kformat.cpp:55
QString formatRelativeDate(const QDate &date, QLocale::FormatType format) const
Returns a string formatted to a relative date style.
Definition kformat.cpp:70
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:04:24 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.