Merge pull request #1300 from duncanspumpkin/fix_profit

Fix profit
This commit is contained in:
Ted John 2015-06-10 18:11:28 +01:00
commit 8a71ade8c6
2 changed files with 11 additions and 6 deletions

View File

@ -1842,7 +1842,7 @@ STR_1837 :Satisfaction: Unknown
STR_1838 :Satisfaction: {COMMA16}%
STR_1839 :Reliability: {COMMA16}%
STR_1840 :Down-time: {COMMA16}%
STR_1841 :Profit: {CURRENCY} per hour
STR_1841 :Profit: {CURRENCY2DP} per hour
STR_1842 :Favourite of: {COMMA16} guest
STR_1843 :Favourite of: {COMMA16} guests
STR_1844 :{SMALLFONT}{BLACK}Select information type to show in ride/attraction list
@ -1859,7 +1859,7 @@ STR_1854 :{WINDOW_COLOUR_2}Built: {BLACK}Last Year
STR_1855 :{WINDOW_COLOUR_2}Built: {BLACK}{COMMA16} Years Ago
STR_1856 :{WINDOW_COLOUR_2}Profit per item sold: {BLACK}{CURRENCY2DP}
STR_1857 :{WINDOW_COLOUR_2}Loss per item sold: {BLACK}{CURRENCY2DP}
STR_1858 :{WINDOW_COLOUR_2}Cost: {BLACK}{CURRENCY} per month
STR_1858 :{WINDOW_COLOUR_2}Cost: {BLACK}{CURRENCY2DP} per month
STR_1859 :Handymen
STR_1860 :Mechanics
STR_1861 :Security Guards
@ -1874,8 +1874,8 @@ STR_1869 :{WINDOW_COLOUR_2}Number of rotations:
STR_1870 :{SMALLFONT}{BLACK}Number of complete rotations
STR_1871 :{POP16}{POP16}{POP16}{POP16}{POP16}{POP16}{POP16}{POP16}{POP16}{COMMA16}
STR_1872 :{COMMA16}
STR_1873 :{WINDOW_COLOUR_2}Income: {BLACK}{CURRENCY} per hour
STR_1874 :{WINDOW_COLOUR_2}Profit: {BLACK}{CURRENCY} per hour
STR_1873 :{WINDOW_COLOUR_2}Income: {BLACK}{CURRENCY2DP} per hour
STR_1874 :{WINDOW_COLOUR_2}Profit: {BLACK}{CURRENCY2DP} per hour
STR_1875 :{BLACK} {SPRITE}{BLACK} {STRINGID}
STR_1876 :{WINDOW_COLOUR_2}{INLINE_SPRITE}{251}{19}{00}{00}Inspect Rides
STR_1877 :{WINDOW_COLOUR_2}{INLINE_SPRITE}{252}{19}{00}{00}Fix Rides

View File

@ -301,9 +301,15 @@ void format_currency(char **dest, long long value)
// Negative sign
if (value < 0) {
// Round the value away from zero
value = (value - 99) / 100;
*(*dest)++ = '-';
value = -value;
}
else{
//Round the value away from zero
value = (value + 99) / 100;
}
// Currency symbol
const char *symbol = currencySpec->symbol;
@ -314,8 +320,7 @@ void format_currency(char **dest, long long value)
*dest += strlen(*dest);
}
// Divide by 100 to get rid of the pennies
format_comma_separated_integer(dest, value / 100);
format_comma_separated_integer(dest, value);
// Currency symbol suffix
if (currencySpec->affix == CURRENCY_SUFFIX) {