forked from organicmaps/organicmaps
[qt] Fix locales
Signed-off-by: Gonzalo Pesquero <gpesquero@yahoo.es>
This commit is contained in:
parent
fd02e21fa7
commit
79b01b77c5
2 changed files with 5 additions and 8 deletions
|
@ -102,6 +102,9 @@ public:
|
|||
|
||||
int main(int argc, char * argv[])
|
||||
{
|
||||
// Refresh system locale for distance & speed formatting.
|
||||
measurement_utils::RefreshSystemLocale();
|
||||
|
||||
// Our double parsing code (base/string_utils.hpp) needs dots as a floating point delimiters, not commas.
|
||||
// TODO: Refactor our doubles parsing code to use locale-independent delimiters.
|
||||
// For example, https://github.com/google/double-conversion can be used.
|
||||
|
|
10
qt/ruler.cpp
10
qt/ruler.cpp
|
@ -1,6 +1,7 @@
|
|||
#include "qt/ruler.hpp"
|
||||
|
||||
#include "geometry/mercator.hpp"
|
||||
#include "platform/distance.hpp"
|
||||
|
||||
#include <iomanip>
|
||||
#include <string>
|
||||
|
@ -52,13 +53,6 @@ void Ruler::SetDistance()
|
|||
|
||||
void Ruler::SetId()
|
||||
{
|
||||
std::ostringstream curValStream;
|
||||
curValStream << std::fixed << std::setprecision(1);
|
||||
if (m_sumDistanceM >= 1000.0)
|
||||
curValStream << m_sumDistanceM / 1000.0 << " km";
|
||||
else
|
||||
curValStream << m_sumDistanceM << " m";
|
||||
|
||||
m_id = curValStream.str();
|
||||
m_id = platform::Distance::CreateFormatted(m_sumDistanceM).ToString();
|
||||
}
|
||||
} // namespace qt
|
||||
|
|
Loading…
Add table
Reference in a new issue