Skip to content

Commit eb8a325

Browse files
authored
Merge pull request #81 from OpenLMIS/OLMIS-8178-compact-quantity-strings
OLMIS-8178: Compact quantity display strings
2 parents 5c021c9 + 77af178 commit eb8a325

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"openlmisQuantityUnitToggle.packs": "Packs",
33
"openlmisQuantityUnitToggle.doses": "Doses",
4-
"openlmisInputDosesPacks.DosesBracket":" doses )"
4+
"openlmisInputDosesPacks.DosesBracket":" )"
55
}

src/openlmis-quantity-unit-toggle/quantity-unit.service.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@
6161
var packs = (stockOnHand > 0) ? Math.floor(stockOnHand / netContent) : Math.ceil(stockOnHand / netContent);
6262
var remainderDoses = stockOnHand % netContent;
6363

64-
return packs + ' ( +' + remainderDoses + messageService.get('openlmisInputDosesPacks.DosesBracket');
64+
var doseSign = remainderDoses < 0 ? '' : '+';
65+
var bracket = messageService.get('openlmisInputDosesPacks.DosesBracket');
66+
return packs + ' ( ' + doseSign + remainderDoses + bracket;
6567
}
6668

6769
/**

0 commit comments

Comments
 (0)