Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Number Formatting
#11
Quote:O_o in qb people used ltrim$( str$( somenum% ) ) :roll: :wink:

No, actually QB people, who are not aware of FB, do:
Code:
num$ = mid$(str$(somenum%),2)
This skips over the leading space generated by the str$ when the number is positive. However, if the number were negative, this would skip over and ignore the leading sign.

What v1ctor has done in FB is to suppress the leading space previously created by the str$ alltogether when the number is positive. This may be aesthetically very pleasing, but it has, and will, lead to confusion.

The solution compatible to QB and FB is to do the following which we've already seen above:
Code:
num$ = ltrim$(str$(somenum%)))
Note: If the number were negative, you get a minus sign as the first character of num$.
*****
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)