-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
improve format track length (issue #1094) #1095
base: master
Are you sure you want to change the base?
Conversation
d18bcdf
to
72be3a6
Compare
@@ -0,0 +1,15 @@ | |||
function formatTrackLength(len, nullable) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Я не нашёл, где formatTrackLength вызывается с двумя параметрами
Но как я написал в коменте в #1094, мне очень не нравится текущее поведение, когда нули после точки отбрасываются. Т.е. я считаю, nullable должен быть всегда true, как было в formatLength()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Вызывалось у меня, но я потом убрал параметр в вызовах, чтобы визуально не шумели, а здесь осталось; у тебя иное видение, значит добавим.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
т.е. я имею в виду, что параметр в функции совсем не нужен, нули просто всегда должны быть.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Согласен частично. Это актуально для списка треков и для измерителя расстояния.
Для треков на карте нули не нужны.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Нужны, т.к. "7.00 km" и "7 km" означает совершенное разное.
Первое это 6.995-7.005, а второе это 6.5-7.5
@@ -415,7 +416,7 @@ const ElevationProfile = L.Class.extend({ | |||
<tr><td>Avg / Max descent inclination:</td><td>${d.descentAngleStr}</td></tr> | |||
<tr class="start-group"><td>Total ascent:</td><td>${d.approx}${d.ascent}</td></tr> | |||
<tr><td>Total descent:</td><td>${d.approx}${d.descent}</td></tr> | |||
<tr class="start-group"><td>Distance:</td><td>${d.dist} km</td></tr> | |||
<tr class="start-group"><td>Distance:</td><td>${distance}</td></tr> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Надо ещё distanceStr
в setCursorPosition()
поправить
72be3a6
to
30210f5
Compare
No description provided.