Jump to content

allocate specific width for a number


Rskm
 Share

Recommended Posts

Hi, i am writing an output to notepad. The output has few columns, the contents of which is all numbers (floats & or integers). The issue is that i cannot get the columns appear straight as if a number in the column becomes negative, it pushes the number in the next column to right or viceversa. So, is it possible to allocate a fixed number of columns per number

something like  Filewrite($notepad,my_format($xl_limit,10)&my_format($maxx,10)&my_format($pp_ar_total,10)).. where my_format would mean 10 columns to be allocated for the variable

 thanks 

Edited by Rskm
more explanation
Link to comment
Share on other sites

Link to comment
Share on other sites

19 minutes ago, Nine said:

Yes you can with StringFormat ().  Look in help file, there is numerous examples how you can do it...

Hi, I tried the below option 

Filewrite($notepad,stringformat("%-20.3",$xl_limit&$maxx&$pp_ar_total&@crlf)).  this is  just printing %-20.3 .. what i need is to print the variables xl_limit, maxx and pp_ar_total in a line with 20 columns allocated and with 3 decimals. 

Link to comment
Share on other sites

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...