Here you can find the source of intToString(final int value)
Parameter | Description |
---|---|
value | an integer value to be converted |
public static String intToString(final int value)
//package com.java2s; /*/*from w w w .j a v a 2s.c o m*/ * Copyright 2012 Igor Maznitsa (http://www.igormaznitsa.com) * * This file is part of the JVM to Z80 translator project (hereinafter referred to as J2Z80). * * J2Z80 is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * J2Z80 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with J2Z80. If not, see <http://www.gnu.org/licenses/>. */ public class Main { /** * Convert an integer into an ASM HEX representation * @param value an integer value to be converted * @return a hex string representation of the integer */ public static String intToString(final int value) { final StringBuilder result = new StringBuilder(); result.append(value).append("(#").append(Integer.toHexString(value).toUpperCase()).append(')'); return result.toString(); } }