From 3af338a75b9783b5430d390abc4ef60cda29e469 Mon Sep 17 00:00:00 2001 From: kopareigns <kopareigns@gmail.com> Date: Wed, 22 Aug 2018 23:21:30 -0400 Subject: [PATCH] Display Consistency --- src/events/intro/introSummary.tw | 4 +++- src/pregmod/basenationalitiesControls.tw | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/events/intro/introSummary.tw b/src/events/intro/introSummary.tw index b2e50cff8fe..4ff9f8ae65f 100644 --- a/src/events/intro/introSummary.tw +++ b/src/events/intro/introSummary.tw @@ -76,9 +76,11 @@ You are using standardized slave trading channels. [[Customize the slave trade|C <</if>> <br style="clear:both" /><hr style="margin:0"> <<set _len = Object.keys($nationalitiescheck).length>> + <<set _j = 0>> <<for _nation, _i range $nationalitiescheck>> <<print _nation>> @@.orange;<<print (($nationalities[_nation]/hashSum($nationalities))*100).toFixed(2)>>%@@ - <<if _i < _len-1>> | <</if>> + <<set _j++>> + <<if _j < _len>> | <</if>> <</for>> <br style="clear:both" /><hr style="margin:0"> <</if>> /* closes $customVariety is defined */ diff --git a/src/pregmod/basenationalitiesControls.tw b/src/pregmod/basenationalitiesControls.tw index d2b378ca8f1..680769a7e3c 100644 --- a/src/pregmod/basenationalitiesControls.tw +++ b/src/pregmod/basenationalitiesControls.tw @@ -20,9 +20,11 @@ /* Prints distribution of $nationalities, using $nationalitiescheck to render array */ <<set _percentPerPoint = 100.0 / hashSum($nationalities)>> <<set _len = Object.keys($nationalitiescheck).length>> +<<set _j = 0>> <<for _nation, _i range $nationalitiescheck>> _nation @@.orange;<<= ($nationalities[_nation] * _percentPerPoint).toFixed(2)>>%@@ - <<if _len != 0>> | <</if>> + <<set _j++>> + <<if _j < _len>> | <</if>> <</for>> <<unset _percentPerPoint>> <br><br> -- GitLab