首页 > 解决方案 > Decimals translated by browser when a dropdown is used

问题描述

The dot is removed by the browser and results in a value of 25 if you choose 0.25 (hence the error below).

dot gets removed by the browser

The example config with listitems results in a dropdown in TFS. This works fine in Firefox. Chrome and Internet Explorer remove the dot and e.g. transform the value 0.5 to 5

<FIELD name="Effort" refname="Microsoft.VSTS.Scheduling.Effort" type="Double" reportable="measure" formula="sum">
    <HELPTEXT>The estimated effort to implemented the backlog item</HELPTEXT>
    <ALLOWEDVALUES expanditems="true">
        <LISTITEM value="0" />
        <LISTITEM value="0.25" />
        <LISTITEM value="0.5" />
        <LISTITEM value="1" />
        <LISTITEM value="2" />
        <LISTITEM value="3" />
        <LISTITEM value="5" />
    </ALLOWEDVALUES>
</FIELD>

It can be solved for Internet Explorer by putting English as language preference, but that is not a solution since most of our users have set Dutch. Setting the dot as a decimal separator isn't a solution either, because Dutch uses a comma for that.

enter image description here

How can I solve this without bothering the end user?

标签: browserinternationalization

解决方案


您需要定义一个控制字段。请按照本教程进行操作,它一定会对您有所帮助。单击此处控制字段编号格式

或者你也可以试试我的样品

<Control Type="FieldControl" FieldName="Microsoft.VSTS.Scheduling.Effort"  Label="Rough Estimation:" LabelPosition="Left" NumberFormat="DecimalNumbers" />

随意询问它是否不起作用。谢谢


推荐阅读