转换十六进制数在Java中,以十进制(安卓) [英] Convert Hexadecimal number to decimal in Java (Android)

查看:145
本文介绍了转换十六进制数在Java中,以十进制(安卓)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如在上面的标题。我想在从十六进制数的EditText

 的EditText数=(EditText上)findViewById(R.id.etDisplay);
编辑stringEditable = number.getText()的toString。
字符串诺沃= stringEditable.toString();
 

我想诺沃转换为十进制数

解决方案

  INT I =的Integer.parseInt(诺沃,16);
 

As in the title above. I want take the hex number from an EditText

EditText number = (EditText) findViewById (R.id.etDisplay);
Editable stringEditable = number.getText().toString;
String nuovo = stringEditable.toString();

I want to convert nuovo to a decimal number.

解决方案

int i= Integer.parseInt(nuovo,16);

这篇关于转换十六进制数在Java中,以十进制(安卓)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆