Unfortunately PRINT USING is fairly American, and doesn't really know about internationalisation.
Likely you'll have to write a routine yourself (or even better, wait a few days and someone will likely come along with one for you).
Hi zaadstra
your homework is:
print an integer number using the point for dividing the thousand multiple at the place of the comma.
PRINT USING let format the output of the number but it divides the thousand multiple using the comma.
Here one of the thousand possible solutionsCode: QB64: [Select]
this can be optimized to save time (for example storing in a variable the result of LEN(in) instead of calculating each time this same result)
Good Enjoying with programming
Ha I was expecting @RhoSigma to come along ;-)) must be on Holidays.
A I noticed the American bias
It's not just in the USA that a comma separator is used. We use it here in the UK too. Just out of interest, what country are you in?I'm in The Netherlands. (hi neigbour!)
Tested and I think fails on neg numbers:
[ This attachment cannot be displayed inline in 'Print Page' view ]
But is true you don't need $ for string constants or other suffix for other constants.
Wouldn't an easy solution here be to just print to a temp screen, read the output into a string, and then swap the periods and commas?
Here's a format$ routine that I worked up in the past. All it needs is to swap periods for commas, correct?Code: QB64: [Select]
format$ = t$
Wouldn't an easy solution here be to just print to a temp screen, read the output into a string, and then swap the periods and commas?
Here's a format$ routine that I worked up in the past. All it needs is to swap periods for commas, correct?
Thanks for showing this code, I wasn't familiar with the posibility of temp screens. This may open a lot of new ideas as your examples shows. I am going to play with this one!
It is the only screen I use, graphics are not for me.
Only wishing it was somewhat more flexiible, bigger, resizeable, copy text from it (in win ctrl-C) ...
I'm still thinking I haven't seen all new goodies from QB64, compared to QB4.5! ;-)
Amazing! But so offtopic ;-) I've got it working and will play around with this.
You might also try adding a $RESIZE command to your code. ;)Noted! :-) I know my way around on the Wiki but do not always see the connection between the (new) commands.