public static String formattingFinishedPercentage ( final RolloutGroup rolloutGroup , final float finishedPercentage ) { float tmpFinishedPercentage = 0 ; switch ( rolloutGroup . getStatus ( ) ) { case READY : case SCHEDULED : case ERROR : tmpFinishedPercentage = 0.0F ; break ; case FINISHED : tmpFinishedPercentage = 100.0F ; break ; case RUNNING : tmpFinishedPercentage = finishedPercentage ; break ; default : break ; } return String . format ( "%.1f" , tmpFinishedPercentage ) ; }
Formats the finished percentage of a rollout group into a string with one digit after comma .