本文整理匯總了Java中com.trollworks.toolkit.utility.text.Numbers.formatWithForcedSign方法的典型用法代碼示例。如果您正苦於以下問題:Java Numbers.formatWithForcedSign方法的具體用法?Java Numbers.formatWithForcedSign怎麽用?Java Numbers.formatWithForcedSign使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.trollworks.toolkit.utility.text.Numbers
的用法示例。
在下文中一共展示了Numbers.formatWithForcedSign方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getAmountAsString
import com.trollworks.toolkit.utility.text.Numbers; //導入方法依賴的package包/類
/** @return The amount, as a {@link String}. */
public String getAmountAsString() {
if (mInteger) {
return Numbers.formatWithForcedSign(getIntegerAmount());
}
return Numbers.formatWithForcedSign(mAmount);
}
示例2: getSkillDisplayLevel
import com.trollworks.toolkit.utility.text.Numbers; //導入方法依賴的package包/類
/**
* Creates a string suitable for displaying the level.
*
* @param level The skill level.
* @param relativeLevel The relative skill level.
* @param attribute The attribute the skill is based on.
* @param isContainer Whether this skill is a container or not.
* @return The formatted string.
*/
public static String getSkillDisplayLevel(int level, int relativeLevel, SkillAttribute attribute, boolean isContainer) {
if (isContainer) {
return EMPTY;
}
if (level < 0) {
return "-"; //$NON-NLS-1$
}
return Numbers.format(level) + SLASH + attribute + Numbers.formatWithForcedSign(relativeLevel);
}
示例3: getDisplayLevel
import com.trollworks.toolkit.utility.text.Numbers; //導入方法依賴的package包/類
private static String getDisplayLevel(SkillAttribute attribute, int level, int relativeLevel) {
if (level < 0) {
return "-"; //$NON-NLS-1$
}
return Numbers.format(level) + "/" + attribute + Numbers.formatWithForcedSign(relativeLevel); //$NON-NLS-1$
}
示例4: getTechniqueDisplayLevel
import com.trollworks.toolkit.utility.text.Numbers; //導入方法依賴的package包/類
/**
* Creates a string suitable for displaying the level.
*
* @param level The skill level.
* @param relativeLevel The relative skill level.
* @param modifier The modifer to the skill level.
* @return The formatted string.
*/
public static String getTechniqueDisplayLevel(int level, int relativeLevel, int modifier) {
if (level < 0) {
return "-"; //$NON-NLS-1$
}
return Numbers.format(level) + "/" + Numbers.formatWithForcedSign(relativeLevel + modifier); //$NON-NLS-1$
}