java - 打印 float

标签 java android

我正在创建 Android 应用程序,我需要使用 textView 打印 float 。有人能告诉我应该使用哪个功能吗?

最佳答案

试试这个:

//Retrieve the TextView and set the text
Float yourFloat = 1.0;
TextView textView = (TextView) findViewById(R.id.yourtextview);
textView.setText(yourFloat.toString());

关于java - 打印 float ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7050472/

相关文章:

android - 在genymotion设备上安装应用程序,满足:“INSTALL_FAILED_CPU_ABI_INCOMPATIBLE”

android - 无法在 Android Studio 中启动 AVD

android - 在回收者 View 中跳过项目

java - 刷新文本/JLabel 值

java - 显示所选文件

java - 出现 - TreeMap

java - ApacheShiro - 使用 Storm 路径的 SSO

java - 同一服务器上的多个 java webapp

java - 第二个 Activity 不会返回到第一个 Activity

android - flavor A 的 Robolectric 测试用例通过而 flavor B 失败