8.1.3.7 DataObject::GetDataFormat
It is recommended that you switch to the originpro package. PyOrigin is primarily for users who need to work with Origin version prior to 2021. |
Description
Get DataFormat property of one DataObject
Syntax
GetDataFormat()
Parameters
Return
- the code for format.
- 0: Numeric
- 1: Text
- 2: Time
- 3: Date
- 9: Text and Numeric
Examples
#Create Sheet in Book1 with 5 columns #the following code will set column formats in a new worksheet # 1st column - Numeric (0) # 2nd column - Text (1) # 3rd column - Time (2) # 4th column - Date (3) # 5th column - Text and Numeric (9) wks=PyOrigin.WorksheetPages('Book1').Layers(0) Formats="01239" wks.SetColFormats(Formats) Col_0=wks.Columns(0) if Col_0.GetDataFormat()==0: print('Numeric') elif Col_0.GetDataFormat()==1: print('Text') elif Col_0.GetDataFormat()==2: print('Date')