mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-07-01 10:06:49 -04:00
Imprment string trimr to remove spaces at the end of aircraft name.
(cherry picked from commit 70fd4039938cdd45f03d541e0aff1238de85fb3e)
This commit is contained in:
parent
567fee1d98
commit
ef151e243b
2 changed files with 9 additions and 0 deletions
|
@ -255,3 +255,9 @@ double get_decimals(double num, int16_t mult, bool round) {
|
||||||
if (num > .5) intnum++; //Round up
|
if (num > .5) intnum++; //Round up
|
||||||
return intnum;
|
return intnum;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string trimr(std::string str)
|
||||||
|
{
|
||||||
|
size_t last = str.find_last_not_of(' ');
|
||||||
|
return (last!=std::string::npos) ? str.substr(0, last+1) : ""; // Remove the trailing spaces
|
||||||
|
}
|
|
@ -58,4 +58,7 @@ std::string to_string_FAT_timestamp(const FATTimestamp& timestamp);
|
||||||
|
|
||||||
std::string unit_auto_scale(double n, const uint32_t base_nano, uint32_t precision);
|
std::string unit_auto_scale(double n, const uint32_t base_nano, uint32_t precision);
|
||||||
double get_decimals(double num, int16_t mult, bool round = false); //euquiq added
|
double get_decimals(double num, int16_t mult, bool round = false); //euquiq added
|
||||||
|
|
||||||
|
std::string trimr(std::string str); // Remove trailing spaces
|
||||||
|
|
||||||
#endif/*__STRING_FORMAT_H__*/
|
#endif/*__STRING_FORMAT_H__*/
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue