Can you create more than 3 decimal digit in the create number to text block?
This block basically helps convert a number value, to a string value in GKC with commas if needed. It’s REALLY useful. The only problem I have with this however, is the fact that it can only go up to 3 digits when the number contains over 3 decimal digits. This was a problem in my Pythagorean Theorem guide. I figured how to make it go up to WAY more decimal digits. The thing is, it just gets so messy. take example for the number: 19238291289.201. It’s really messy. Admit it.
Using the “Create text with” block helps a lot when calculating, but when it gets to a number like the one above, its not as helpful as it was before.
Look at this experiment:
Make a text property named “Number”
Make a trigger that has these blocks:
You will find that once triggered, it will only show 3 decimal digits.
However if you change the CNTO(WC) block with the “Create Text with” block with 1 input (Thx to @Fulcrum-19 for discovering this) I will show the full number, without commas. But it looks very messy.
Below, and behold; My image.
Hopefully you can understand it with all the external input formatting.
Mini explanation:
This is in a notification device for testing purposes so ignore the last block.
Since you can’t use decimals in properties, I did a little extra (so you can easily change the number being translated). I had 2 properties(2 whole numbers; testNum = 100000000, testNum2 = 314159) which I turned into a decimal number (output is 100000000.314159). Then in the “a” variable, I found the decimal point in a number and added 4 to the letter # of that point, the first decimal place that isn’t included in the “Create Number to Text w/ commas” block. From there, I made another variable “o” that go the number and converted it into a text number with commas. The subtraction in the “o” variable is to make sure there are no decimal numbers past the 3rd decimal place upon conversion so that it doesn’t round the decimals.[1] Finally, in variable “i”, I added 2 variables (the one holding the extra decimals and the one holding the converted number with commas) to create the final number. In this case the final number is 100,000,000.314159. This algorithm works no matter what numbers you input into the 2 properties (or so I’ve tested) :D
Anyways, I did this on a whim so I’ll provide more help after my hour or so walk.
For example, if I converted 3.14159 to text with the “Create number to text w/ commas” block, it would result with 3.142 instead of 3.141 ↩︎