Skip to content

Use fractions for voice only#383

Merged
frederoni merged 6 commits into
masterfrom
fred-fractions-for-voice
Jul 24, 2017
Merged

Use fractions for voice only#383
frederoni merged 6 commits into
masterfrom
fred-fractions-for-voice

Conversation

@frederoni
Copy link
Copy Markdown
Contributor

Fixes #375 - Use fractions for voice

@1ec5 @bsudekum 👀

@frederoni frederoni requested review from 1ec5 and bsudekum July 13, 2017 14:49
@frederoni frederoni added the ⚠️ DO NOT MERGE PR should not be merged! label Jul 13, 2017
@bsudekum
Copy link
Copy Markdown
Contributor

🍿

Copy link
Copy Markdown
Contributor

@1ec5 1ec5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on a cursory reading of this method, the combination of a maximumSignificantDigits of 2 and a roundingIncrement of 0.25 will cause the following behavior as the user nears the maneuver point:

Display Upper Lower Difference
2.0 mi 2.125 1.875 0.25
1.8 mi 1.8749 1.626 0.25
1.5 mi 1.625 1.375 0.25
1.2 mi 1.3749 1.126 0.25
1.0 mi 1.125 0.875 0.25
0.75 mi 0.8749 0.626 0.25
0.5 mi 0.625 0.375 0.25
0.25 mi 0.3749 0.2 0.18
1,000 ft 0.2

The “Difference” column shows that there will be an even progression if the user travels at a constant speed. That’s good. Unfortunately, the label will alternate between 2 and 3 digits, which could be distracting.

We could make the label length more consistent by changing the rounding increment for display numbers to 0.2. However, note that users of the U.S. customary system have much better intuition about quarters of a mile than tenths or fifths of a mile. Also, if we change to issuing alerts at the one-mile and half-mile marks on freeways, rather than basing the alerts on the time left, it would be nice for the alerts and label to be consistent with one another.

(Personally, I would’ve preferred to explore enlarging the vulgar fractions or setting them in a more legible font. That way we could also retain consistency with road signage in the U.S. and UK. However, I’m in a distinct minority on this point.)

Given the large difference in behavior between voice and display usage of this class, this might be a good opportunity to split it into two classes: DistanceFormatter and SpokenDistanceFormatter.

@frederoni
Copy link
Copy Markdown
Contributor Author

I agree about the consistency with road signage but this feels like one of those cases where clarity and optical alignment surpasses consistency just like the geometry of a roundabout should be simplified when it's represented as an icon. However, I'd prefer fractions if we would show the distance within a static shield that looks like the road signage but counting down almost like an animation does not look good with fractions.

from #375

We should switch to 1 decimal of precision in the turn banner < 2 miles, and whole numbers over 3 miles.

That should solve the excessive alternating decimals.

Given the large difference in behavior between voice and display usage of this class, this might be a good opportunity to split it into two classes: DistanceFormatter and SpokenDistanceFormatter.

Let's do that. 👍

@frederoni frederoni force-pushed the fred-fractions-for-voice branch 2 times, most recently from 4f0c85d to 55b7440 Compare July 16, 2017 17:10
@frederoni frederoni removed the ⚠️ DO NOT MERGE PR should not be merged! label Jul 16, 2017
Copy link
Copy Markdown
Contributor Author

@frederoni frederoni Jul 18, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note en_GB does not return "Metric" which is correct. However, it doesn't help with the overriding of en_GB -> en_US as long as we use NSLengthFormatter instead of MKDistanceFormatter.

Details
Locale Measurement system
eu Metric
hr_BA Metric
en_CM Metric
en_BI Metric
rw_RW Metric
ast Metric
en_SZ Metric
he_IL Metric
ar Metric
uz_Arab Metric
en_PN Metric
as Metric
en_NF Metric
ks_IN Metric
rwk_TZ Metric
zh_Hant_TW Metric
en_CN Metric
gsw_LI Metric
ta_IN Metric
th_TH Metric
es_EA Metric
fr_GF Metric
ar_001 Metric
en_RW Metric
tr_TR Metric
de_CH Metric
ee_TG Metric
en_NG Metric
fr_TG Metric
az Metric
fr_SC Metric
es_HN Metric
en_AG Metric
ru_KZ Metric
gsw Metric
dyo Metric
so_ET Metric
zh_Hant_MO Metric
de_BE Metric
nus_SS Metric
km_KH Metric
my_MM U.S.
mgh_MZ Metric
ee_GH Metric
es_EC Metric
kw_GB U.K.
rm_CH Metric
en_ME Metric
nyn Metric
mk_MK Metric
bs_Cyrl_BA Metric
ar_MR Metric
en_BM Metric
ms_Arab Metric
en_AI Metric
gl_ES Metric
en_PR Metric
ff_CM Metric
ne_IN Metric
or_IN Metric
khq_ML Metric
en_MG Metric
pt_TL Metric
en_LC Metric
ta_SG Metric
iu_CA Metric
jmc_TZ Metric
om_ET Metric
lv_LV Metric
es_US U.S.
en_PT Metric
vai_Latn_LR U.S.
yue_HK Metric
en_NL Metric
to_TO Metric
cgg_UG Metric
ta Metric
en_MH Metric
zu_ZA Metric
shi_Latn_MA Metric
brx_IN Metric
ar_KM Metric
en_AL Metric
te Metric
chr_US U.S.
yo_BJ Metric
fr_VU Metric
pa Metric
tg Metric
kea Metric
ksh_DE Metric
sw_CD Metric
te_IN Metric
fr_RE Metric
th Metric
ur_IN Metric
yo_NG Metric
ti Metric
guz_KE Metric
tk Metric
kl_GL Metric
ksf_CM Metric
mua_CM Metric
lag_TZ Metric
lb Metric
fr_TN Metric
es_PA Metric
pl_PL Metric
to Metric
hi_IN Metric
dje_NE Metric
es_GQ Metric
en_BR Metric
kok_IN Metric
pl Metric
fr_GN Metric
bem Metric
ha Metric
ckb Metric
lg Metric
tr Metric
en_PW Metric
en_NO Metric
nyn_UG Metric
sr_Latn_RS Metric
gsw_FR Metric
pa_Guru Metric
he Metric
sn_ZW Metric
qu_BO Metric
lu_CD Metric
mgo_CM Metric
ps_AF Metric
en_BS Metric
da Metric
ps Metric
ln Metric
pt Metric
hi Metric
lo Metric
ebu Metric
de Metric
gu_IN Metric
seh Metric
en_CX Metric
en_ZM Metric
fr_HT Metric
fr_GP Metric
lt Metric
lu Metric
ln_CD Metric
vai_Latn U.S.
el_GR Metric
lv Metric
en_KE Metric
sbp Metric
hr Metric
en_CY Metric
es_GT Metric
twq_NE Metric
zh_Hant_HK Metric
kln_KE Metric
fr_GQ Metric
chr U.S.
hu Metric
es_UY Metric
fr_CA Metric
ms_BN Metric
en_NR Metric
mer Metric
shi Metric
es_PE Metric
fr_SN Metric
bez Metric
sw_TZ Metric
wae_CH Metric
kkj Metric
hy Metric
teo_KE Metric
en_CZ Metric
dz_BT Metric
teo Metric
ar_JO Metric
mer_KE Metric
khq Metric
ln_CF Metric
nn_NO Metric
en_MO Metric
ar_TD Metric
dz Metric
ses Metric
en_BW Metric
en_AS Metric
ar_IL Metric
nnh Metric
bo_CN Metric
teo_UG Metric
hy_AM Metric
ln_CG Metric
sr_Latn_BA Metric
en_MP Metric
ksb_TZ Metric
ar_SA Metric
smn_FI Metric
ar_LY Metric
en_AT Metric
so_KE Metric
fr_CD Metric
af_NA Metric
en_NU Metric
es_PH Metric
en_KI Metric
en_JE Metric
lkt U.S.
en_AU Metric
fa_IR Metric
uz_Latn_UZ Metric
zh_Hans_CN Metric
ewo_CM Metric
fr_PF Metric
ca_IT Metric
en_BZ Metric
ar_KW Metric
pt_GW Metric
fr_FR Metric
am_ET Metric
en_VC Metric
fr_DJ Metric
fr_CF Metric
es_SV Metric
en_MS Metric
pt_ST Metric
ar_SD Metric
luy_KE Metric
gd_GB U.K.
de_LI Metric
fr_CG Metric
ckb_IQ Metric
zh_Hans_SG Metric
en_MT Metric
ha_NE Metric
ewo Metric
af_ZA Metric
os_GE Metric
om_KE Metric
nl_SR Metric
es_ES Metric
es_DO Metric
ar_IQ Metric
fr_CH Metric
nnh_CM Metric
es_419 Metric
en_MU Metric
en_US_POSIX U.S.
yav_CM Metric
luo_KE Metric
dua_CM Metric
et_EE Metric
en_IE Metric
ak_GH Metric
rwk Metric
es_CL Metric
kea_CV Metric
fr_CI Metric
ckb_IR Metric
fr_BE Metric
se Metric
en_NZ Metric
en_MV Metric
en_LR U.S.
ha_NG Metric
en_KN Metric
nb_SJ Metric
sg Metric
sr_Cyrl_RS Metric
ru_RU Metric
en_ZW Metric
sv_AX Metric
si Metric
ga_IE Metric
en_VG Metric
ff_MR Metric
sk Metric
ky_KG Metric
agq_CM Metric
mzn Metric
fr_BF Metric
sl Metric
en_MW Metric
mr_IN Metric
az_Latn Metric
en_LS Metric
de_AT Metric
ka Metric
naq_NA Metric
sn Metric
sr_Latn_ME Metric
fr_NC Metric
so Metric
is_IS Metric
twq Metric
ig_NG Metric
sq Metric
fo_FO Metric
sr Metric
tzm Metric
ga Metric
om Metric
en_LT Metric
bas_CM Metric
se_NO Metric
ki Metric
nl_BE Metric
ar_QA Metric
gd U.K.
sv Metric
kk Metric
sw Metric
es_CO Metric
az_Latn_AZ Metric
rn_BI Metric
or Metric
kl Metric
ca Metric
en_VI Metric
km Metric
os Metric
en_MY Metric
kn Metric
en_LU Metric
fr_SY Metric
ar_TN Metric
en_JM Metric
fr_PM Metric
ko Metric
fr_NE Metric
ce Metric
fr_MA Metric
gl Metric
ru_MD Metric
saq_KE Metric
ks Metric
fr_CM Metric
lb_LU Metric
gv_IM Metric
fr_BI Metric
en_LV Metric
en_KR Metric
es_NI Metric
en_GB U.K.
kw U.K.
nl_SX Metric
dav_KE Metric
tr_CY Metric
ky Metric
en_UG Metric
en_TC Metric
ar_EG Metric
fr_BJ Metric
gu Metric
es_PR Metric
fr_RW Metric
sr_Cyrl_BA Metric
lrc_IQ Metric
gv Metric
fr_MC Metric
cs Metric
bez_TZ Metric
es_CR Metric
asa_TZ Metric
ar_EH Metric
fo_DK Metric
ms_Arab_BN Metric
en_JP Metric
sbp_TZ Metric
en_IL Metric
lt_LT Metric
mfe Metric
en_GD Metric
cy U.K.
ug_CN Metric
ca_FR Metric
es_BO Metric
fr_BL Metric
bn_IN Metric
uz_Cyrl_UZ Metric
lrc_IR Metric
az_Cyrl Metric
en_IM Metric
sw_KE Metric
en_SB Metric
pa_Arab Metric
ur_PK Metric
haw_US U.S.
ar_SO Metric
en_IN Metric
fil Metric
fr_MF Metric
en_WS Metric
es_CU Metric
ja_JP Metric
fy_NL Metric
en_SC Metric
en_IO Metric
pt_PT Metric
en_HK Metric
en_GG Metric
fr_MG Metric
de_LU Metric
tzm_MA Metric
en_SD Metric
shi_Tfng Metric
ln_AO Metric
as_IN Metric
en_GH Metric
ms_MY Metric
ro_RO Metric
jgo_CM Metric
dua Metric
en_UM Metric
en_SE Metric
kn_IN Metric
en_KY Metric
vun_TZ Metric
kln Metric
lrc Metric
en_GI Metric
ca_ES Metric
rof Metric
pt_CV Metric
kok Metric
pt_BR Metric
ar_DJ Metric
yi_001 Metric
fi_FI Metric
zh Metric
es_PY Metric
ar_SS Metric
mua Metric
sr_Cyrl_ME Metric
vai_Vaii_LR U.S.
en_001 Metric
nl_NL Metric
en_TK Metric
si_LK Metric
en_SG Metric
sv_SE Metric
fr_DZ Metric
ca_AD Metric
pt_AO Metric
vi Metric
xog_UG Metric
xog Metric
en_IS Metric
nb Metric
seh_MZ Metric
ars Metric
es_AR Metric
sk_SK Metric
en_SH Metric
ti_ER Metric
nd Metric
az_Cyrl_AZ Metric
zu Metric
ne Metric
nd_ZW Metric
el_CY Metric
en_IT Metric
nl_BQ Metric
da_GL Metric
ja Metric
rm Metric
fr_ML Metric
rn Metric
en_VU Metric
rof_TZ Metric
ro Metric
ebu_KE Metric
ru_KG Metric
en_SI Metric
sg_CF Metric
mfe_MU Metric
nl Metric
brx Metric
bs_Latn Metric
fa Metric
zgh_MA Metric
en_GM Metric
shi_Latn Metric
en_FI Metric
nn Metric
en_EE Metric
ru Metric
yue Metric
kam_KE Metric
fur Metric
vai_Vaii U.S.
ar_ER Metric
rw Metric
ti_ET Metric
ff Metric
luo Metric
fa_AF Metric
nl_CW Metric
en_HR Metric
en_FJ Metric
fi Metric
pt_MO Metric
be Metric
en_US U.S.
en_TO Metric
en_SK Metric
bg Metric
ru_BY Metric
it_IT Metric
ml_IN Metric
gsw_CH Metric
qu_EC Metric
fo Metric
sv_FI Metric
en_FK Metric
nus Metric
ta_LK Metric
vun Metric
sr_Latn Metric
es_BZ Metric
fr Metric
en_SL Metric
bm Metric
ar_BH Metric
guz Metric
bn Metric
bo Metric
ar_SY Metric
lo_LA Metric
ne_NP Metric
uz_Latn Metric
be_BY Metric
es_IC Metric
sr_Latn_XK Metric
ar_MA Metric
pa_Guru_IN Metric
br Metric
luy Metric
kde_TZ Metric
bs Metric
fy Metric
fur_IT Metric
hu_HU Metric
ar_AE Metric
en_HU Metric
sah_RU Metric
zh_Hans Metric
en_FM Metric
sq_AL Metric
ko_KP Metric
en_150 Metric
en_DE Metric
ce_RU Metric
en_CA Metric
hsb_DE Metric
fr_MQ Metric
en_TR Metric
ro_MD Metric
es_VE Metric
tg_TJ Metric
fr_WF Metric
mt_MT Metric
kab Metric
nmg_CM Metric
ms_SG Metric
en_GR Metric
ru_UA Metric
fr_MR Metric
zh_Hans_MO Metric
ff_GN Metric
bs_Cyrl Metric
sw_UG Metric
ko_KR Metric
en_DG Metric
bo_IN Metric
en_CC Metric
shi_Tfng_MA Metric
lag Metric
it_SM Metric
os_RU Metric
en_TT Metric
ms_Arab_MY Metric
sq_MK Metric
bem_ZM Metric
kde Metric
ar_OM Metric
kk_KZ Metric
cgg Metric
bas Metric
kam Metric
wae Metric
es_MX Metric
sah Metric
zh_Hant Metric
en_GU Metric
fr_MU Metric
fr_KM Metric
ar_LB Metric
en_BA Metric
en_TV Metric
sr_Cyrl Metric
mzn_IR Metric
dje Metric
kab_DZ Metric
fil_PH Metric
se_SE Metric
vai U.S.
hr_HR Metric
bs_Latn_BA Metric
nl_AW Metric
dav Metric
so_SO Metric
ar_PS Metric
en_FR Metric
uz_Cyrl Metric
ff_SN Metric
en_BB Metric
ki_KE Metric
en_TW Metric
naq Metric
en_SS Metric
mg_MG Metric
mas_KE Metric
en_RO Metric
en_PG Metric
mgh Metric
dyo_SN Metric
mas Metric
agq Metric
bn_BD Metric
haw U.S.
yi Metric
nb_NO Metric
da_DK Metric
en_DK Metric
saq Metric
ug Metric
cy_GB U.K.
fr_YT Metric
jmc Metric
ses_ML Metric
en_PH Metric
de_DE Metric
ar_YE Metric
bm_ML Metric
yo Metric
lkt_US U.S.
uz_Arab_AF Metric
jgo Metric
sl_SI Metric
uk Metric
en_CH Metric
asa Metric
lg_UG Metric
qu_PE Metric
mgo Metric
id_ID Metric
en_NA Metric
en_GY Metric
zgh Metric
pt_MZ Metric
fr_LU Metric
ta_MY Metric
mas_TZ Metric
en_DM Metric
dsb Metric
mg Metric
en_BE Metric
ur Metric
fr_GA Metric
ka_GE Metric
nmg Metric
en_TZ Metric
eu_ES Metric
ar_DZ Metric
id Metric
so_DJ Metric
hsb Metric
yav Metric
mk Metric
pa_Arab_PK Metric
ml Metric
en_ER Metric
ig Metric
se_FI Metric
mn Metric
ksb Metric
uz Metric
vi_VN Metric
ii Metric
qu Metric
en_PK Metric
ee Metric
ast_ES Metric
mr Metric
ms Metric
en_ES Metric
ha_GH Metric
it_CH Metric
sq_XK Metric
mt Metric
en_CK Metric
br_FR Metric
tk_TM Metric
sr_Cyrl_XK Metric
ksf Metric
en_SX Metric
bg_BG Metric
en_PL Metric
af Metric
el Metric
cs_CZ Metric
fr_TD Metric
zh_Hans_HK Metric
is Metric
ksh Metric
my U.S.
mn_MN Metric
en U.S.
it Metric
dsb_DE Metric
ii_CN Metric
smn Metric
iu Metric
eo Metric
en_ZA Metric
en_AD Metric
ak Metric
en_RU Metric
kkj_CM Metric
am Metric
es Metric
et Metric
uk_UA Metric

@frederoni
Copy link
Copy Markdown
Contributor Author

@bsudekum @1ec5 This PR is ready for a round 👀

Copy link
Copy Markdown
Contributor

@bsudekum bsudekum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I was looking for an update between 0.2 miles and 1000ft, but overall this feels good.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use == instead of contains(_:)? Is it possible for the measurement system to be prefixed or suffixed?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of exposing forcedLocale only to tests, we could expose the measurement system as an option on this class, so that the developer can implement a setting like the one provided by Apple Maps. It would still be necessary to set numberFormatter.locale in tests, for the case where the host system is set to a locale that uses commas as decimal separators, for instance.

Copy link
Copy Markdown
Contributor Author

@frederoni frederoni Jul 19, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed the forcedLocale but can you elaborate a bit on how you would expose the measurement system? I assume you mean switching between metric and imperial units? The measurementSystem is non-binary but I guess we could roll our own measurement system type (metric, imperial instead of metric, US, UK)

Details
Locale Measurement system
eu Metric
hr_BA Metric
en_CM Metric
en_BI Metric
rw_RW Metric
ast Metric
en_SZ Metric
he_IL Metric
ar Metric
uz_Arab Metric
en_PN Metric
as Metric
en_NF Metric
ks_IN Metric
rwk_TZ Metric
zh_Hant_TW Metric
en_CN Metric
gsw_LI Metric
ta_IN Metric
th_TH Metric
es_EA Metric
fr_GF Metric
ar_001 Metric
en_RW Metric
tr_TR Metric
de_CH Metric
ee_TG Metric
en_NG Metric
fr_TG Metric
az Metric
fr_SC Metric
es_HN Metric
en_AG Metric
ru_KZ Metric
gsw Metric
dyo Metric
so_ET Metric
zh_Hant_MO Metric
de_BE Metric
nus_SS Metric
km_KH Metric
my_MM U.S.
mgh_MZ Metric
ee_GH Metric
es_EC Metric
kw_GB U.K.
rm_CH Metric
en_ME Metric
nyn Metric
mk_MK Metric
bs_Cyrl_BA Metric
ar_MR Metric
en_BM Metric
ms_Arab Metric
en_AI Metric
gl_ES Metric
en_PR Metric
ff_CM Metric
ne_IN Metric
or_IN Metric
khq_ML Metric
en_MG Metric
pt_TL Metric
en_LC Metric
ta_SG Metric
iu_CA Metric
jmc_TZ Metric
om_ET Metric
lv_LV Metric
es_US U.S.
en_PT Metric
vai_Latn_LR U.S.
yue_HK Metric
en_NL Metric
to_TO Metric
cgg_UG Metric
ta Metric
en_MH Metric
zu_ZA Metric
shi_Latn_MA Metric
brx_IN Metric
ar_KM Metric
en_AL Metric
te Metric
chr_US U.S.
yo_BJ Metric
fr_VU Metric
pa Metric
tg Metric
kea Metric
ksh_DE Metric
sw_CD Metric
te_IN Metric
fr_RE Metric
th Metric
ur_IN Metric
yo_NG Metric
ti Metric
guz_KE Metric
tk Metric
kl_GL Metric
ksf_CM Metric
mua_CM Metric
lag_TZ Metric
lb Metric
fr_TN Metric
es_PA Metric
pl_PL Metric
to Metric
hi_IN Metric
dje_NE Metric
es_GQ Metric
en_BR Metric
kok_IN Metric
pl Metric
fr_GN Metric
bem Metric
ha Metric
ckb Metric
lg Metric
tr Metric
en_PW Metric
en_NO Metric
nyn_UG Metric
sr_Latn_RS Metric
gsw_FR Metric
pa_Guru Metric
he Metric
sn_ZW Metric
qu_BO Metric
lu_CD Metric
mgo_CM Metric
ps_AF Metric
en_BS Metric
da Metric
ps Metric
ln Metric
pt Metric
hi Metric
lo Metric
ebu Metric
de Metric
gu_IN Metric
seh Metric
en_CX Metric
en_ZM Metric
fr_HT Metric
fr_GP Metric
lt Metric
lu Metric
ln_CD Metric
vai_Latn U.S.
el_GR Metric
lv Metric
en_KE Metric
sbp Metric
hr Metric
en_CY Metric
es_GT Metric
twq_NE Metric
zh_Hant_HK Metric
kln_KE Metric
fr_GQ Metric
chr U.S.
hu Metric
es_UY Metric
fr_CA Metric
ms_BN Metric
en_NR Metric
mer Metric
shi Metric
es_PE Metric
fr_SN Metric
bez Metric
sw_TZ Metric
wae_CH Metric
kkj Metric
hy Metric
teo_KE Metric
en_CZ Metric
dz_BT Metric
teo Metric
ar_JO Metric
mer_KE Metric
khq Metric
ln_CF Metric
nn_NO Metric
en_MO Metric
ar_TD Metric
dz Metric
ses Metric
en_BW Metric
en_AS Metric
ar_IL Metric
nnh Metric
bo_CN Metric
teo_UG Metric
hy_AM Metric
ln_CG Metric
sr_Latn_BA Metric
en_MP Metric
ksb_TZ Metric
ar_SA Metric
smn_FI Metric
ar_LY Metric
en_AT Metric
so_KE Metric
fr_CD Metric
af_NA Metric
en_NU Metric
es_PH Metric
en_KI Metric
en_JE Metric
lkt U.S.
en_AU Metric
fa_IR Metric
uz_Latn_UZ Metric
zh_Hans_CN Metric
ewo_CM Metric
fr_PF Metric
ca_IT Metric
en_BZ Metric
ar_KW Metric
pt_GW Metric
fr_FR Metric
am_ET Metric
en_VC Metric
fr_DJ Metric
fr_CF Metric
es_SV Metric
en_MS Metric
pt_ST Metric
ar_SD Metric
luy_KE Metric
gd_GB U.K.
de_LI Metric
fr_CG Metric
ckb_IQ Metric
zh_Hans_SG Metric
en_MT Metric
ha_NE Metric
ewo Metric
af_ZA Metric
os_GE Metric
om_KE Metric
nl_SR Metric
es_ES Metric
es_DO Metric
ar_IQ Metric
fr_CH Metric
nnh_CM Metric
es_419 Metric
en_MU Metric
en_US_POSIX U.S.
yav_CM Metric
luo_KE Metric
dua_CM Metric
et_EE Metric
en_IE Metric
ak_GH Metric
rwk Metric
es_CL Metric
kea_CV Metric
fr_CI Metric
ckb_IR Metric
fr_BE Metric
se Metric
en_NZ Metric
en_MV Metric
en_LR U.S.
ha_NG Metric
en_KN Metric
nb_SJ Metric
sg Metric
sr_Cyrl_RS Metric
ru_RU Metric
en_ZW Metric
sv_AX Metric
si Metric
ga_IE Metric
en_VG Metric
ff_MR Metric
sk Metric
ky_KG Metric
agq_CM Metric
mzn Metric
fr_BF Metric
sl Metric
en_MW Metric
mr_IN Metric
az_Latn Metric
en_LS Metric
de_AT Metric
ka Metric
naq_NA Metric
sn Metric
sr_Latn_ME Metric
fr_NC Metric
so Metric
is_IS Metric
twq Metric
ig_NG Metric
sq Metric
fo_FO Metric
sr Metric
tzm Metric
ga Metric
om Metric
en_LT Metric
bas_CM Metric
se_NO Metric
ki Metric
nl_BE Metric
ar_QA Metric
gd U.K.
sv Metric
kk Metric
sw Metric
es_CO Metric
az_Latn_AZ Metric
rn_BI Metric
or Metric
kl Metric
ca Metric
en_VI Metric
km Metric
os Metric
en_MY Metric
kn Metric
en_LU Metric
fr_SY Metric
ar_TN Metric
en_JM Metric
fr_PM Metric
ko Metric
fr_NE Metric
ce Metric
fr_MA Metric
gl Metric
ru_MD Metric
saq_KE Metric
ks Metric
fr_CM Metric
lb_LU Metric
gv_IM Metric
fr_BI Metric
en_LV Metric
en_KR Metric
es_NI Metric
en_GB U.K.
kw U.K.
nl_SX Metric
dav_KE Metric
tr_CY Metric
ky Metric
en_UG Metric
en_TC Metric
ar_EG Metric
fr_BJ Metric
gu Metric
es_PR Metric
fr_RW Metric
sr_Cyrl_BA Metric
lrc_IQ Metric
gv Metric
fr_MC Metric
cs Metric
bez_TZ Metric
es_CR Metric
asa_TZ Metric
ar_EH Metric
fo_DK Metric
ms_Arab_BN Metric
en_JP Metric
sbp_TZ Metric
en_IL Metric
lt_LT Metric
mfe Metric
en_GD Metric
cy U.K.
ug_CN Metric
ca_FR Metric
es_BO Metric
fr_BL Metric
bn_IN Metric
uz_Cyrl_UZ Metric
lrc_IR Metric
az_Cyrl Metric
en_IM Metric
sw_KE Metric
en_SB Metric
pa_Arab Metric
ur_PK Metric
haw_US U.S.
ar_SO Metric
en_IN Metric
fil Metric
fr_MF Metric
en_WS Metric
es_CU Metric
ja_JP Metric
fy_NL Metric
en_SC Metric
en_IO Metric
pt_PT Metric
en_HK Metric
en_GG Metric
fr_MG Metric
de_LU Metric
tzm_MA Metric
en_SD Metric
shi_Tfng Metric
ln_AO Metric
as_IN Metric
en_GH Metric
ms_MY Metric
ro_RO Metric
jgo_CM Metric
dua Metric
en_UM Metric
en_SE Metric
kn_IN Metric
en_KY Metric
vun_TZ Metric
kln Metric
lrc Metric
en_GI Metric
ca_ES Metric
rof Metric
pt_CV Metric
kok Metric
pt_BR Metric
ar_DJ Metric
yi_001 Metric
fi_FI Metric
zh Metric
es_PY Metric
ar_SS Metric
mua Metric
sr_Cyrl_ME Metric
vai_Vaii_LR U.S.
en_001 Metric
nl_NL Metric
en_TK Metric
si_LK Metric
en_SG Metric
sv_SE Metric
fr_DZ Metric
ca_AD Metric
pt_AO Metric
vi Metric
xog_UG Metric
xog Metric
en_IS Metric
nb Metric
seh_MZ Metric
ars Metric
es_AR Metric
sk_SK Metric
en_SH Metric
ti_ER Metric
nd Metric
az_Cyrl_AZ Metric
zu Metric
ne Metric
nd_ZW Metric
el_CY Metric
en_IT Metric
nl_BQ Metric
da_GL Metric
ja Metric
rm Metric
fr_ML Metric
rn Metric
en_VU Metric
rof_TZ Metric
ro Metric
ebu_KE Metric
ru_KG Metric
en_SI Metric
sg_CF Metric
mfe_MU Metric
nl Metric
brx Metric
bs_Latn Metric
fa Metric
zgh_MA Metric
en_GM Metric
shi_Latn Metric
en_FI Metric
nn Metric
en_EE Metric
ru Metric
yue Metric
kam_KE Metric
fur Metric
vai_Vaii U.S.
ar_ER Metric
rw Metric
ti_ET Metric
ff Metric
luo Metric
fa_AF Metric
nl_CW Metric
en_HR Metric
en_FJ Metric
fi Metric
pt_MO Metric
be Metric
en_US U.S.
en_TO Metric
en_SK Metric
bg Metric
ru_BY Metric
it_IT Metric
ml_IN Metric
gsw_CH Metric
qu_EC Metric
fo Metric
sv_FI Metric
en_FK Metric
nus Metric
ta_LK Metric
vun Metric
sr_Latn Metric
es_BZ Metric
fr Metric
en_SL Metric
bm Metric
ar_BH Metric
guz Metric
bn Metric
bo Metric
ar_SY Metric
lo_LA Metric
ne_NP Metric
uz_Latn Metric
be_BY Metric
es_IC Metric
sr_Latn_XK Metric
ar_MA Metric
pa_Guru_IN Metric
br Metric
luy Metric
kde_TZ Metric
bs Metric
fy Metric
fur_IT Metric
hu_HU Metric
ar_AE Metric
en_HU Metric
sah_RU Metric
zh_Hans Metric
en_FM Metric
sq_AL Metric
ko_KP Metric
en_150 Metric
en_DE Metric
ce_RU Metric
en_CA Metric
hsb_DE Metric
fr_MQ Metric
en_TR Metric
ro_MD Metric
es_VE Metric
tg_TJ Metric
fr_WF Metric
mt_MT Metric
kab Metric
nmg_CM Metric
ms_SG Metric
en_GR Metric
ru_UA Metric
fr_MR Metric
zh_Hans_MO Metric
ff_GN Metric
bs_Cyrl Metric
sw_UG Metric
ko_KR Metric
en_DG Metric
bo_IN Metric
en_CC Metric
shi_Tfng_MA Metric
lag Metric
it_SM Metric
os_RU Metric
en_TT Metric
ms_Arab_MY Metric
sq_MK Metric
bem_ZM Metric
kde Metric
ar_OM Metric
kk_KZ Metric
cgg Metric
bas Metric
kam Metric
wae Metric
es_MX Metric
sah Metric
zh_Hant Metric
en_GU Metric
fr_MU Metric
fr_KM Metric
ar_LB Metric
en_BA Metric
en_TV Metric
sr_Cyrl Metric
mzn_IR Metric
dje Metric
kab_DZ Metric
fil_PH Metric
se_SE Metric
vai U.S.
hr_HR Metric
bs_Latn_BA Metric
nl_AW Metric
dav Metric
so_SO Metric
ar_PS Metric
en_FR Metric
uz_Cyrl Metric
ff_SN Metric
en_BB Metric
ki_KE Metric
en_TW Metric
naq Metric
en_SS Metric
mg_MG Metric
mas_KE Metric
en_RO Metric
en_PG Metric
mgh Metric
dyo_SN Metric
mas Metric
agq Metric
bn_BD Metric
haw U.S.
yi Metric
nb_NO Metric
da_DK Metric
en_DK Metric
saq Metric
ug Metric
cy_GB U.K.
fr_YT Metric
jmc Metric
ses_ML Metric
en_PH Metric
de_DE Metric
ar_YE Metric
bm_ML Metric
yo Metric
lkt_US U.S.
uz_Arab_AF Metric
jgo Metric
sl_SI Metric
uk Metric
en_CH Metric
asa Metric
lg_UG Metric
qu_PE Metric
mgo Metric
id_ID Metric
en_NA Metric
en_GY Metric
zgh Metric
pt_MZ Metric
fr_LU Metric
ta_MY Metric
mas_TZ Metric
en_DM Metric
dsb Metric
mg Metric
en_BE Metric
ur Metric
fr_GA Metric
ka_GE Metric
nmg Metric
en_TZ Metric
eu_ES Metric
ar_DZ Metric
id Metric
so_DJ Metric
hsb Metric
yav Metric
mk Metric
pa_Arab_PK Metric
ml Metric
en_ER Metric
ig Metric
se_FI Metric
mn Metric
ksb Metric
uz Metric
vi_VN Metric
ii Metric
qu Metric
en_PK Metric
ee Metric
ast_ES Metric
mr Metric
ms Metric
en_ES Metric
ha_GH Metric
it_CH Metric
sq_XK Metric
mt Metric
en_CK Metric
br_FR Metric
tk_TM Metric
sr_Cyrl_XK Metric
ksf Metric
en_SX Metric
bg_BG Metric
en_PL Metric
af Metric
el Metric
cs_CZ Metric
fr_TD Metric
zh_Hans_HK Metric
is Metric
ksh Metric
my U.S.
mn_MN Metric
en U.S.
it Metric
dsb_DE Metric
ii_CN Metric
smn Metric
iu Metric
eo Metric
en_ZA Metric
en_AD Metric
ak Metric
en_RU Metric
kkj_CM Metric
am Metric
es Metric
et Metric
uk_UA Metric

then remove the en-GB override and force a particular unit using NSLengthFormatter.string(fromValue:unit:)?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we could roll our own measurement system type (metric, imperial instead of metric, US, UK)

I could see metric/U.S./UK being a useful three-way option, since the UK measures some road distances in yards whereas the U.S. does not.

We could still choose a good default for our own measurementSystem property based on a combination of the locale’s measurementSystem and the region (for the UK).

@frederoni frederoni force-pushed the fred-fractions-for-voice branch from 55b7440 to 7cf0f26 Compare July 19, 2017 13:19
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason to leave the default rounding increment at 0.25 if we're truncating to 1 decimal place?

Copy link
Copy Markdown
Contributor

@ericrwolfe ericrwolfe Jul 20, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might want to add tests for non-perfect distances. It's not clear what the behavior should be from the current test cases. E.g. 0.25, 0.75, 1.28328, 2.75738.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we set the cutoff at exactly 3 miles with a rounding increment of 0.25, I think that means 3.0 miles becomes “3” while 2.9 miles becomes “3.0”. That would be odd.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor Author

@frederoni frederoni Jul 21, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this quarter mile displayed correctly?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we’re using the formatter to count down to a maneuver, I suppose it’s better to undercount than to overcount.

@frederoni frederoni force-pushed the fred-fractions-for-voice branch from d547ea9 to cbf808d Compare July 21, 2017 13:03
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we use this grouping separator here?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The grouping separator is very important when there are more than two significant figures. But if we’re rounding up to the hundreds and lack the space to display it, I suppose we could get away with omitting it. In any case, I think it’s really unlikely that anyone would misread “1,000 feet” as “1.000 feet” (that is, one and zero thousandths).

Does the grouping separator ever occur when the formatter uses the metric system?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It did show "1,000 m" before I forced "1,000 m" to display "1 km" (5bd709d#diff-cbb2b216ecdb63112349c1a2e9642224R118)

@frederoni frederoni force-pushed the fred-fractions-for-voice branch 3 times, most recently from 1e1d421 to 5bd709d Compare July 21, 2017 13:55
@frederoni frederoni force-pushed the fred-fractions-for-voice branch from 5bd709d to 5bcea5a Compare July 23, 2017 14:31
@frederoni frederoni merged commit e8e93ca into master Jul 24, 2017
@frederoni frederoni deleted the fred-fractions-for-voice branch July 27, 2017 23:39
@1ec5 1ec5 mentioned this pull request Sep 18, 2019
mappy-mobile pushed a commit to Mappy/mapbox-navigation-ios that referenced this pull request Sep 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants