mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2024-12-13 19:54:39 +00:00
Fixed left padding of the decimal part of the numbers.
This commit is contained in:
parent
93ce2b04c0
commit
22e8add4dd
@ -250,10 +250,10 @@ void ADSBRxView::on_frame(const ADSBFrameMessage * message) {
|
||||
entry.set_info_string(str_info);
|
||||
logentry+=log_info + " ";
|
||||
|
||||
if(send_updates && details_view->get_current_entry().ICAO_address == ICAO_address) {
|
||||
// we only want to update the details view if the frame
|
||||
// we received has the same ICAO address, i.e. belongs to
|
||||
// the same aircraft:
|
||||
if(send_updates && details_view->get_current_entry().ICAO_address == ICAO_address) {
|
||||
details_view->update(entry);
|
||||
}
|
||||
}
|
||||
@ -263,8 +263,8 @@ void ADSBRxView::on_frame(const ADSBFrameMessage * message) {
|
||||
" Hdg:" + to_string_dec_uint(entry.velo.heading) +
|
||||
" Spd: "+ to_string_dec_int(entry.velo.speed);
|
||||
|
||||
if (send_updates && details_view->get_current_entry().ICAO_address == ICAO_address) {
|
||||
// same here:
|
||||
if (send_updates && details_view->get_current_entry().ICAO_address == ICAO_address) {
|
||||
details_view->update(entry);
|
||||
}
|
||||
}
|
||||
|
@ -124,7 +124,7 @@ std::string to_string_decimal(float decimal, int8_t precision) {
|
||||
fractional_part = -fractional_part;
|
||||
}
|
||||
|
||||
result = to_string_dec_int(integer_part) + "." + to_string_dec_uint(fractional_part, precision);
|
||||
result = to_string_dec_int(integer_part) + "." + to_string_dec_uint(fractional_part, precision, '0');
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -160,7 +160,9 @@ int cpr_NL_approx(float lat) {
|
||||
int cpr_NL(float lat) {
|
||||
// TODO prove that the approximate function is good
|
||||
// enough for the precision we need. Uncomment if
|
||||
// that is true:
|
||||
// that is true. No performance penalty was noticed
|
||||
// from testing, but if you find it might be an issue,
|
||||
// switch to cpr_NL_approx() instead:
|
||||
|
||||
//return cpr_NL_approx(lat);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user