Java Hex Calculate toHex(int n, int s)

Here you can find the source of toHex(int n, int s)

Description

to Hex

License

Apache License

Declaration

protected static String toHex(int n, int s) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    protected static String toHex(int n, int s) {
        String str = "0000000000000000" + Integer.toHexString(n);
        return str.substring(str.length() - s);
    }//from  w ww . j  a va2s  .c  o  m
}

Related

  1. toHex(int myByte)
  2. toHex(int n)
  3. toHex(int n)
  4. toHex(int n, Boolean bigEndian)
  5. toHex(int n, int bytes)
  6. toHex(int nibble)
  7. toHex(int num)
  8. toHex(int nybble)
  9. toHex(int r, int g, int b)