![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| 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) |
| | Custom format numeric values Hi, How to make a custom format for my numeric values. I need to format respectively 5197213 and 459832 to 51.97213 and 4.59832 (dot - 5 decimal) Regards, Robertico |
My System Specs![]() |
| | #2 (permalink) |
| | RE: Custom format numeric values Is this just for display or do you want to keep it as a numeric format with a fixed 5 decimal places?? if just for display try "{0:F5} {1:F5}" -f (5197213/100000), (459832/100000) -- Richard Siddaway All scripts are supplied "as is" and with no warranty PowerShell MVP Blog: http://richardsiddaway.spaces.live.com/ PowerShell User Group: http://www.get-psuguk.org.uk "Robertico" wrote: Quote: > Hi, > > How to make a custom format for my numeric values. > I need to format respectively 5197213 and 459832 to 51.97213 and 4.59832 > (dot - 5 decimal) > > Regards, > > Robertico > > > |
My System Specs![]() |
| | #3 (permalink) |
| | Re: Custom format numeric values You can format the numbers with the zero placeholder format specifier: PS > "{0:0\.00000}" -f 5197213 51.97213 PS > "{0:0\.00000}" -f 459832 4.59832 --- Shay Levy Windows PowerShell MVP http://blogs.microsoft.co.il/blogs/ScriptFanatic PowerShell Toolbar: http://tinyurl.com/PSToolbar R> Hi, R> R> How to make a custom format for my numeric values. R> I need to format respectively 5197213 and 459832 to 51.97213 and R> 4.59832 R> (dot - 5 decimal) R> Regards, R> R> Robertico R> |
My System Specs![]() |
| | #4 (permalink) |
| | Re: Custom format numeric values Shay, "{0:0\.00000}" ... thats the trick.... i forgot the backslash before the decimal dot. (the output is saved as text file !) Thanks and regards, Robertico "Shay Levy [MVP]" <no@xxxxxx> wrote in message news:89228ed249ad38caf4abbf7c4ad4@xxxxxx Quote: > > You can format the numbers with the zero placeholder format specifier: > > > PS > "{0:0\.00000}" -f 5197213 > 51.97213 > > PS > "{0:0\.00000}" -f 459832 > 4.59832 > > > > --- > Shay Levy > Windows PowerShell MVP > http://blogs.microsoft.co.il/blogs/ScriptFanatic > PowerShell Toolbar: http://tinyurl.com/PSToolbar > > > > R> Hi, > R> R> How to make a custom format for my numeric values. > R> I need to format respectively 5197213 and 459832 to 51.97213 and > R> 4.59832 > R> (dot - 5 decimal) > R> Regards, > R> R> Robertico > R> > |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Custom Now Playing-format in Messenger 2009? | Live Messenger | |||
| -f format Format-Table Format-List against Select | PowerShell | |||
| Need help to split a string into text and numeric values !! | VB Script | |||
| Can I create a Default output format for custom objects | PowerShell | |||
| [Ann] Format-Graph custom CmdLet to display graphics within PowerShell | PowerShell | |||