【发布时间】:2016-09-15 07:52:22
【问题描述】:
使用Integer.toString(1234567, 16).toUpperCase() // output: 12D68 可以帮助将Int 转换为十六进制字符串。
如何对 Long 做同样的事情?
Long.toString(13690566117625, 16).toUpperCase() // but this will report error
【问题讨论】:
-
你遇到了什么错误?如果您使用“
13690566117625L”结尾加上 L 怎么办? -
@kennytm,
Long.toString(13690566117625L, 16).toUpperCase(),它会说error: too many arguments for method toString: ()String
标签: scala hex long-integer