Android numberDecimal不起作用

时间:2018-07-18 16:43:26

标签: java android

我尝试了建议:

a <- data.table("TYPE" = c("A", "A", "B", "B",
                       "C", "C", "C", "C",
                       "D", "D", "D", "D",
                       "D", "D", "D", "D"), 
            "DATE" = c("4/20/2018 11:47",
                       "4/25/2018 7:21",
                       "4/15/2018 6:11",
                       "4/19/2018 4:22",
                       "4/15/2018 17:46",
                       "4/16/2018 11:59",
                       "4/20/2018 7:50",
                       "4/26/2018 2:55",
                       "4/27/2018 11:46",
                       "4/27/2018 13:03",
                       "4/20/2018 7:31",
                       "4/22/2018 9:45",
                       "6/01/2018 9:07",
                       "6/03/2018 12:34",
                       "6/07/2018 1:57",
                       "6/10/2018 2:22"),
            "CLASS" = c(1, 2, 3, 4,
                        1, 2, 3, 4,
                        1, 2, 3, 4,
                        1, 2, 3, 4))

但没有人允许使用“。”或“,”数字

任何人都可以帮助

2 个答案:

答案 0 :(得分:1)

您需要将两个属性( android:inputType android:digits )添加到您的editText中,如下所示:

<EditText
        android:layout_height="wrap_content"
        android:layout_width="match_parent"
        android:inputType="numberDecimal"
        android:digits="0123456789.,"/>

答案 1 :(得分:0)

尝试使用:

<EditText 
  android:inputType="text" 
  android:digits="0,.1,.2,.3,.4,.5,.6,.7,.8,.9,." />