Index: apps/gui/skin_engine/skin_tokens.c =================================================================== --- apps/gui/skin_engine/skin_tokens.c (Revision 26008) +++ apps/gui/skin_engine/skin_tokens.c (Arbeitskopie) @@ -345,12 +345,28 @@ #if CONFIG_TUNER -/* Formats the frequency (specified in Hz) in MHz, */ -/* with two digits after the decimal point */ -static void format_freq_MHz(int freq, char *buf, int buf_size) +/* Formats the frequency (specified in Hz) in MHz, */ +/* with one or two digits after the decimal point -- */ +/* depending on the frequency changing step */ +static void format_freq_MHz(int freq, int freq_step, char *buf, int buf_size) { - freq = freq / 10000; - snprintf(buf, buf_size, "%d.%02d", freq/100, freq%100); + int scale, div; + char *fmt; + if (freq_step < 100000) + { + /* Format with two digits after decimal point */ + scale = 10000; + fmt = "%d.%02d"; + } + else + { + /* Format with one digit after decimal point */ + scale = 100000; + fmt = "%d.%d"; + } + div = 1000000 / scale; + freq = freq / scale; + snprintf(buf, buf_size, fmt, freq/div, freq%div); } @@ -358,6 +374,8 @@ const char *get_radio_token(struct wps_token *token, int preset_offset, char *buf, int buf_size, int limit, int *intval) { + const struct fm_region_data *region_data = + &(fm_region_data[global_settings.fm_region]); (void)limit; switch (token->type) { @@ -376,19 +394,19 @@ return NULL; case WPS_TOKEN_TUNER_MINFREQ: /* changes based on "region" */ { - format_freq_MHz(fm_region_data[global_settings.fm_region].freq_min, + format_freq_MHz(region_data->freq_min, region_data->freq_step, buf, buf_size); return buf; } case WPS_TOKEN_TUNER_MAXFREQ: /* changes based on "region" */ { - format_freq_MHz(fm_region_data[global_settings.fm_region].freq_max, + format_freq_MHz(region_data->freq_max, region_data->freq_step, buf, buf_size); return buf; } case WPS_TOKEN_TUNER_CURFREQ: { - format_freq_MHz(radio_current_frequency(), + format_freq_MHz(radio_current_frequency(), region_data->freq_step, buf, buf_size); return buf; } @@ -413,7 +431,7 @@ } else { - format_freq_MHz(radio_get_preset(preset)->frequency, + format_freq_MHz(radio_get_preset(preset)->frequency, region_data->freq_step, buf, buf_size); } return buf; Index: manual/appendix/wps_tags.tex =================================================================== --- manual/appendix/wps_tags.tex (Revision 26008) +++ manual/appendix/wps_tags.tex (Arbeitskopie) @@ -386,11 +386,9 @@ \config{\%tt} & Is the tuner tuned?\\ \config{\%tm} & Scan or preset mode? Scan is ``true'', preset is ``false''.\\ \config{\%ts} & Is the station in stereo?\\ - \config{\%ta} & Minimum frequency (region specific) in MHz, with two - decimal digits.\\ - \config{\%tb} & Maximum frequency (region specific) in MHz, with two - decimal digits.\\ - \config{\%tf} & Current frequency in MHz, with two decimal digits.\\ + \config{\%ta} & Minimum frequency (region specific) in MHz.\\ + \config{\%tb} & Maximum frequency (region specific) in MHz.\\ + \config{\%tf} & Current frequency in MHz.\\ \config{\%Ti} & Current preset id, i.e. 1-based number of the preset within the presets list (usable in playlist viewer).\\ \config{\%Tn} & Current preset name (usable in playlist viewer).\\