fix #1051 (negative profit -> 'loss')

This commit is contained in:
rolux 2012-09-30 01:26:19 +02:00
parent b9e1d4aabf
commit 83b71b6c3c

View file

@ -403,7 +403,8 @@ pandora.ui.infoView = function(data) {
html = []; html = [];
['budget', 'gross', 'profit'].forEach(function(key) { ['budget', 'gross', 'profit'].forEach(function(key) {
data[key] && html.push( data[key] && html.push(
formatKey(key) + Ox.formatCurrency(data[key], '$') formatKey(key == 'profit' && data[key] < 0 ? 'loss' : key)
+ Ox.formatCurrency(Math.abs(data[key]), '$')
); );
}); });
$div.html(html.join('; ')); $div.html(html.join('; '));