Java Long to Hex LongToHexString(final long value)

Here you can find the source of LongToHexString(final long value)

Description

Long To Hex String

License

Creative Commons License

Declaration

public final static String LongToHexString(final long value) 

Method Source Code

//package com.java2s;
//License from project: Creative Commons License 

public class Main {
    public final static String LongToHexString(final long value) {
        final String string = Long.toString(value, 16).toUpperCase();

        if (string.charAt(0) == '-') {
            return "-0X" + string.substring(1, string.length()) + "L";
        } else {/* www . ja va 2s  .c  o  m*/
            return "0X" + string + "L";
        }
    }
}

Related

  1. longToHex(long val, char delim)
  2. longToHexBytes(final long v)
  3. longToHexBytes(long i)
  4. longToHexChars(long value, int length)
  5. longToHexStr(long src, int len, int code)
  6. longToHexString(long n, int digits)
  7. longToHexString(long num)
  8. longToHexString(long number)
  9. longtoHexString(long wert, int bits)