From 7d3864d19f7bad8a34d66ba53be32b4122e19291 Mon Sep 17 00:00:00 2001
From: Blank_Alt <12406-Blank_Alt@users.noreply.gitgud.io>
Date: Mon, 20 Jan 2020 08:30:23 -0800
Subject: [PATCH] Hook up optional and seperate forced num text support

---
 src/js/utilsFC.js                  | 7 ++++++-
 src/uncategorized/futureSociety.tw | 9 +--------
 2 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/src/js/utilsFC.js b/src/js/utilsFC.js
index cc1f4d7f947..840ec398f51 100644
--- a/src/js/utilsFC.js
+++ b/src/js/utilsFC.js
@@ -948,9 +948,10 @@ window.Categorizer.prototype.cat = function(val, def) {
 /**
  * Returns numbers as text, e.g. 10 as "ten", according to the player's settings
  * @param {number} x
+ * @param {string} printText
  * @returns {string}
  */
-window.num = function(x) {
+window.num = function(x, printText = '') {
 	const max = V.showNumbersMax;
 
 	const ONE_TO_NINETEEN = [
@@ -1025,6 +1026,10 @@ window.num = function(x) {
 		return words.filter(isTruthy).join(" ");
 	}
 
+	if (printText !== '') {
+		return inEnglish(x);
+	}
+
 	/**
 	 * append the word for a scale. Made for use with Array.map
 	 * @param {string} chunk
diff --git a/src/uncategorized/futureSociety.tw b/src/uncategorized/futureSociety.tw
index 21f231b9575..c9abb5331bc 100644
--- a/src/uncategorized/futureSociety.tw
+++ b/src/uncategorized/futureSociety.tw
@@ -495,14 +495,7 @@
 
 You have unlocked
 <span class="detail">
-<<if ($FSGotRepCredits == 7)>>seven
-<<elseif ($FSGotRepCredits == 6)>>six
-<<elseif ($FSGotRepCredits == 5)>>five
-<<elseif ($FSGotRepCredits == 4)>>four
-<<elseif ($FSGotRepCredits == 3)>>three
-<<elseif ($FSGotRepCredits == 2)>>two
-<<else>>one
-<</if>>
+ <<= num($FSGotRepCredits, text)>>
  of <<print $FSCreditCountString>>
 </span>
 possible societal customizations.
-- 
GitLab