From: Erik V. <ev...@us...> - 2009-11-26 20:11:48
|
Update of /cvsroot/rails/18xx/rails/game In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv16640/rails/game Modified Files: Bank.java Log Message: Allow negative values & reorder with minus always in front Index: Bank.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/Bank.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** Bank.java 4 Nov 2009 20:33:22 -0000 1.16 --- Bank.java 26 Nov 2009 20:11:39 -0000 1.17 *************** *** 213,217 **** public static String format(int amount) { ! return instance.moneyFormat.replaceFirst("@", String.valueOf(amount)); } --- 213,221 ---- public static String format(int amount) { ! // Replace @ with the amount ! String result = instance.moneyFormat.replaceFirst("@", String.valueOf(amount)); ! // Move any minus to the front ! if (amount < 0) result = result.replaceFirst("(.+)-", "-$1"); ! return result; } |