![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Number output I wrote a script that gets a computer's site name and creates a group with that name and a number at the end. There will never be more than 600 groups with the same site name. That’s three places to the left of the decimal. I would like there to be four places to the left of the decimal just in case. The naming convention for my groups will be [Group X]-0001. Whenever I start to add numbers I cant seem to get an output 4 places to the left of the decimal. How would I go about doing this? Thanks for all the help. Keith |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Number output "keith" <keithlr2@xxxxxx> wrote in message news:5c971a32-8724-4170-b2ac-f3768771abd0@xxxxxx I wrote a script that gets a computer's site name and creates a group with that name and a number at the end. There will never be more than 600 groups with the same site name. That’s three places to the left of the decimal. I would like there to be four places to the left of the decimal just in case. The naming convention for my groups will be [Group X]-0001. Whenever I start to add numbers I cant seem to get an output 4 places to the left of the decimal. How would I go about doing this? Thanks for all the help. Keith ======== Try this: iNumber = 67 sGroup = "[Group X]-" & right("000" & iNumber, 5) |
My System Specs![]() |
| | #3 (permalink) |
| | Re: Number output "Pegasus (MVP)" <I.can@xxxxxx> wrote in message news:%23O2AuJUCJHA.4176@xxxxxx Quote: > > "keith" <keithlr2@xxxxxx> wrote in message > news:5c971a32-8724-4170-b2ac-f3768771abd0@xxxxxx > I wrote a script that gets a computer's site name and creates a group > with that name and a number at the end. There will never be more than > 600 groups with the same site name. That’s three places to the left > of the decimal. I would like there to be four places to the left of > the decimal just in case. > > The naming convention for my groups will be [Group X]-0001. > > Whenever I start to add numbers I cant seem to get an output 4 places > to the left of the decimal. How would I go about doing this? > > Thanks for all the help. > > Keith > ======== > Try this: > iNumber = 67 > sGroup = "[Group X]-" & right("000" & iNumber, 5) > > sGroup = "[Group X]-" & Right("0000" & iNumber, 4) This should work for iNumber from 0 to 9999. -- Richard Mueller MVP Directory Services Hilltop Lab - http://www.rlmueller.net -- |
My System Specs![]() |
| | #4 (permalink) |
| | Re: Number output On Aug 28, 3:47*pm, "Richard Mueller [MVP]" <rlmueller- nos...@xxxxxx> wrote: Quote: > "Pegasus (MVP)" <I....@xxxxxx> wrote in message > > news:%23O2AuJUCJHA.4176@xxxxxx > > > > > > > Quote: > > "keith" <keith...@xxxxxx> wrote in message > >news:5c971a32-8724-4170-b2ac-f3768771abd0@xxxxxx > > I wrote a script that gets a computer's site name and creates a group > > with that name and a number at the end. *There will never be more than > > 600 groups with the same site name. *That’s three places to the left > > of the decimal. *I would like there to be four places to the left of > > the decimal just in case. Quote: > > The naming convention for my groups will be [Group X]-0001. Quote: > > Whenever I start to add numbers I cant seem to get an output 4 places > > to the left of the decimal. *How would I go about doing this? Quote: > > Thanks for all the help. Quote: > > Keith > > ======== > > Try this: > > iNumber = 67 > > sGroup = "[Group X]-" & right("000" & iNumber, 5) > Shouldn't it be: > > sGroup = "[Group X]-" & Right("0000" & iNumber, 4) > > This should work for iNumber from 0 to 9999. > > -- > Richard Mueller > MVP Directory Services > Hilltop Lab -http://www.rlmueller.net > --- Hide quoted text - > > - Show quoted text - |
My System Specs![]() |
| | #5 (permalink) |
| | Re: Number output In microsoft.public.scripting.vbscript message <e5UZcbUCJHA.2480@xxxxxx NGP02.phx.gbl>, Thu, 28 Aug 2008 14:47:06, "Richard Mueller [MVP]" <rlmueller-nospam@xxxxxx> posted: Quote: > >Shouldn't it be: > >sGroup = "[Group X]-" & Right("0000" & iNumber, 4) > >This should work for iNumber from 0 to 9999. sGroup = "[Group X]-" & Right(10000 + iNumber, 4) which is one character shorter and might be marginally faster -- (c) John Stockton, nr London, UK. ?@merlyn.demon.co.uk Turnpike v6.05 MIME. Web <URL:http://www.merlyn.demon.co.uk/> - FAQish topics, acronyms, & links. Proper <= 4-line sig. separator as above, a line exactly "-- " (SonOfRFC1036) Do not Mail News to me. Before a reply, quote with ">" or "> " (SonOfRFC1036) |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Number of "messages" not relating to actual number | Live Mail | |||
| Enexpected output when using output-csv | PowerShell | |||
| 7z isn't a number | PowerShell | |||
| No output from write-output | PowerShell | |||
| mac number | Vista hardware & devices | |||