FlexCel Studio for VCL/LCL
ContentsIndex
PreviousUpNext
XlsFormatValue1904 Function

Formats a value as Excel would show it in a cell.

Pascal
function XlsFormatValue1904(const V: variant; const Format: UTF16String; const Dates1904: boolean; var Color: Integer): UTF16String;
C++
UTF16String XlsFormatValue1904(const variant V, const UTF16String Format, const boolean Dates1904, int Color);
Parameters 
Description 
const V: variant 
Value to convert. 
const Format: UTF16String 
Format to be applied to the value. This must be an standard Excel format string (like "0.00").  
const Dates1904: boolean 
A boolean indicating if the workbook uses 1904 or 1900 dates. Note that the result will be different depending on this parameter. You will normally get the value for this parameter from TFlexCelImport.Options1904Dates 
var Color: Integer 
Returns the color the text should be in, if the format contains color information. 

The value formatted as a string.

If you have for example the number "1" stored in cell A1, and the format for the cell is "0.00", Excel will displa yin the cell the string "1.00", not just "1". This method allows you to get what should be displayed in a cell based on the value in it and the format of the cell.

Copyright (c) 2002-2008 TMS Software. All rights reserved.
What do you think about this topic? Send feedback!