Rskm Posted January 31, 2020 Posted January 31, 2020 (edited) 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 January 31, 2020 by Rskm more explanation
Nine Posted January 31, 2020 Posted January 31, 2020 (edited) Yes you can with StringFormat (). Look in help file, there is numerous examples how you can do it... Edited January 31, 2020 by Nine “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
Rskm Posted January 31, 2020 Author Posted January 31, 2020 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.
Nine Posted January 31, 2020 Posted January 31, 2020 Try this : Local $v1 = 124.22, $v2 = -2987.5, $v3 = 77777 ConsoleWrite (StringFormat ("% 20.3f% 20.3f% 20.3f", $v1, $v2, $v3) & @CRLF) ConsoleWrite ("123456789012345678901234567890123456789012345678901234567890" & @CRLF) “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
Rskm Posted January 31, 2020 Author Posted January 31, 2020 9 minutes ago, Nine said: Try this : Local $v1 = 124.22, $v2 = -2987.5, $v3 = 77777 ConsoleWrite (StringFormat ("% 20.3f% 20.3f% 20.3f", $v1, $v2, $v3) & @CRLF) ConsoleWrite ("123456789012345678901234567890123456789012345678901234567890" & @CRLF) thanks, that worked.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now