none
Unusual variable type RRS feed

  • Question

  • Does anyone know why Powershell 4.0 interprets the following as a Decimal?

    00e16d.gettype()

    IsPublic IsSerial Name                                     BaseType
    -------- -------- ----                                     --------
    True     True     Decimal                                  System.ValueType

    Thursday, May 12, 2016 6:08 PM

Answers

  • The d at the end assigns the decimal type to the value. If you don't include it, it'll assign the Double type (less precision than decimal type). Another way to do the same thing is ([Decimal]00e16).GetType(). Maybe this helps.
    • Marked as answer by VHBus Thursday, May 12, 2016 6:28 PM
    Thursday, May 12, 2016 6:21 PM

All replies

  • The d at the end assigns the decimal type to the value. If you don't include it, it'll assign the Double type (less precision than decimal type). Another way to do the same thing is ([Decimal]00e16).GetType(). Maybe this helps.
    • Marked as answer by VHBus Thursday, May 12, 2016 6:28 PM
    Thursday, May 12, 2016 6:21 PM
  • Are their more types assign by the ending character?
    Thursday, May 12, 2016 6:28 PM
  • PS D:\scripts> 0x00e16d
    57709
    PS D:\scripts> (0x00e16d).GetType()
    
    IsPublic IsSerial Name                                     BaseType
    -------- -------- ----                                     --------
    True     True     Int32                                    System.ValueType
    
    
    PS D:\scripts>
    
    


    \_(ツ)_/

    Thursday, May 12, 2016 6:39 PM
  • Are their more types assign by the ending character?

    PS D:\scripts> 0l.GetType()

    IsPublic IsSerial Name                                     BaseType
    -------- -------- ----                                     --------
    True     True     Int64                                    System.ValueType


    \_(ツ)_/

    Thursday, May 12, 2016 6:40 PM