📜  streamlit - 警告:下面的 NumberInput 值的类型为 int,因此尽管格式字符串为 %.1f,但仍显示为 int. - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:29.340000             🧑  作者: Mango

代码示例1
import streamlit as st
st.number_input(label="float displayed as integer", format="%i", value=2.4)

# The solution for the waring here is to use format="%i" instead of format="%0f"

# Moreover, here below some options we can use with st.number_input()
prior_variance = st.sidebar.number_input(
label=“Prior Variance”,
min_value=0.00,
value=0.027,
step=0.01,
format="%i",,
)