Discussions related to Visual Prolog
augustinharrison
Active Member
Posts: 29
Joined: 28 Jul 2010 1:28

display lines with numbers same length

Unread post by augustinharrison »

i have an interpreter that uses display. any procedure can write its results using the call to display.
often these result lines have some text then an amount it shows.

display "one example of amt = ", AmoutVariable
display "another example of amt = ", AnotherAmountVariable
on the result page that would show:
one example of amt = 100.00
another example of amt = 200.00

is there a way to make each line the same length and right justify the amount?
possibly using = and or : as the character to split the text from the value, padding to a common length?
aeh
Harrison Pratt
VIP Member
Posts: 432
Joined: 5 Nov 2000 0:01

Re: display lines with numbers same length

Unread post by Harrison Pratt »

See format in the string class.
Post Reply