This question is somewhat related to
this one I already posted, but I'll make another thread because it's not really the same thing.
Does the <<print>> macro add a space at the end of its output? I'm doing the same thing as the other question, displaying the time, but it's displaying text similar to "11 :00 AM", when I want "11:00 AM". Note the space between the "11" and the ":" in the first example.
I'm using the nobr passage tag, and when I tried <<silently>> it output nothing at all. Here's my code, if it's helpful:
<<widget "displayTime">>
<<if ndef $args[0]>>
<<set $workingTime = $time>>
<<else>>
<<set $workingTime = $args[0]>>
<</if>>
<<if $workingTime % 12 == 0>>
<<print "12">>
<<else>>
<<print $workingTime % 12>>
<</if>>
<<print ":00 ">>
<<if $workingTime >= 12>>
<<print "PM">>
<<else>>
<<print "AM">>
<</if>>
<</widget>>
The only solution I see is to add ":00 " at the end of the time printing macros, but that seems like an odd workaround to what I assumed would be a simple thing.
Comments
The reason you're seeing a space between the hours and minutes is because you have whitespace between the hours and minutes <<print>> macros.
Your best bet to resolve that would be to either build the string you want to print, then print it, or stop putting all the whitespace in there. I'd hope the latter is self-explanatory. As an example of the former: (also using some line continuations)
SugarCube has very good documentation and reading that documentation can help to better understand what each feature does. lol