From 34f08a4e0bce46415660d5a88b7c54c39fb8b7b2 Mon Sep 17 00:00:00 2001 From: dm1sh Date: Sun, 17 Apr 2022 11:40:32 +0300 Subject: [PATCH] Added utils --- utils.cpp | 13 +++++++++++++ utils.h | 10 ++++++++++ 2 files changed, 23 insertions(+) create mode 100644 utils.cpp create mode 100644 utils.h diff --git a/utils.cpp b/utils.cpp new file mode 100644 index 0000000..6649a68 --- /dev/null +++ b/utils.cpp @@ -0,0 +1,13 @@ +#include "utils.h" + +wxString LTimeToStr(int time) { + return wxString::Format(_("%d:%02d:%02d"), time / 3600, (time / 60) % 60, time % 60); +} + +int upDiv(int a, int b) { + return a / b + ((a % b) ? 1 : 0); +} + +wxString itowxS(int a) { + return wxString::Format("%i", a); +} \ No newline at end of file diff --git a/utils.h b/utils.h new file mode 100644 index 0000000..dff6caa --- /dev/null +++ b/utils.h @@ -0,0 +1,10 @@ +#ifndef UTILS_H +#define UTILS_H + +#include "wxw.h" + +wxString LTimeToStr(int time); +int upDiv(int a, int b); +wxString itowxS(int a); + +#endif \ No newline at end of file