barsuift.simLife
Class PercentHelper

java.lang.Object
  extended by barsuift.simLife.PercentHelper

public final class PercentHelper
extends java.lang.Object


Method Summary
static java.math.BigDecimal getDecimalValue(int value)
          Returns a BigDecimal value between 0 and 1 from the given value, which must be comprised between 0 and 100
static int getIntValue(java.math.BigDecimal value)
          Returns an integer value between 0 and 100 from the given value, which must be comprised between 0 and 1
static java.lang.String getStringValue(java.math.BigDecimal value)
           
static java.lang.String getStringValue(int value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getDecimalValue

public static java.math.BigDecimal getDecimalValue(int value)
Returns a BigDecimal value between 0 and 1 from the given value, which must be comprised between 0 and 100

Parameters:
value - a value between 0 and 100
Returns:
a decimal value between 0 and 1

getIntValue

public static int getIntValue(java.math.BigDecimal value)
Returns an integer value between 0 and 100 from the given value, which must be comprised between 0 and 1

Returns:
an approximated int value, between 0 and 100 (rounded down)

getStringValue

public static java.lang.String getStringValue(int value)

getStringValue

public static java.lang.String getStringValue(java.math.BigDecimal value)


Copyright © 2010. All Rights Reserved.