我一直在寻找一种在 Dart 编程语言中将十进制数转换为十六进制格式的方法。hex.encode
HexCodec
中的方法例如,类不能转换十进制 1111(十六进制值为 457),而是给出一个异常:
FormatException: Invalid byte 0x457. (at offset 0)
如何将十进制数转换为十六进制数?
最佳答案
int.toRadixString(16)
这样做。
另见 https://groups.google.com/a/dartlang.org/forum/m/#!topic/misc/ljkYEzveYWk
关于Dart:将十进制转换为十六进制,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52356235/