Home About Contact
ForexForums.org




Reply
Old 10-23-2006, 02:21 PM   #1 (permalink)
Administrator
 
kokas's Avatar
 
Join Date: Sep 2006
Location: Portugal
Posts: 507
Convertion Functions

Conversion functions
string CharToStr(
int char_code)

Returns string with one symbol that have specified code
Parameters
char_code
-
ASCII char code.

Sample
string str="WORL" + CharToStr(44); // 44 is code for 'D'
// resulting string will be WORLD

string DoubleToStr(
double value, int digits)

Returns text string with the specified numerical value transformed into the specified precision format.
Parameters
value
-
Numerical value.
digits
-
Precision format, number of digits after decimal point (0-8).

Sample
string value=DoubleToStr(1.28473418, 5);
// value is 1.28473

double NormalizeDouble(
double value, int digits)

Rounds floating point number to specified decimal places.
Parameters
value
-
Floating point value.
digits
-
Precision format, number of digits after decimal point (0-8).

Sample
double var1=0.123456789;
Print(NormalizeDouble(var1,5));
// output: 0.12346

double StrToDouble(
string value)

Converts string representation of number to type double.
Parameters
value
-
String containing value in fixed number format.

Sample
double var=StrToDouble("103.2812");

int StrToInteger(
string value)

Converts string representation of number to type integer.
Parameters
value
-
String containing integer number.

Sample
int var1=StrToInteger("1024");

datetime StrToTime(
string value)

Converts string in the format "yyyy.mm.dd hh:mi" to type datetime.
Parameters
value
-
String value of date/time format such as "yyyy.mm.dd hh:mi".

Sample
datetime var1;
var1=StrToTime("2003.8.12 17:35");
var1=StrToTime("17:35"); // returns with current date
var1=StrToTime("2003.8.12"); // returns with midnight time "00:00"

Attached Files
File Type: doc Conversion functions.doc (41.5 KB, 5 views)
kokas is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
Reply

Bookmarks



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Sedo - Buy and Sell Domain Names and Websites project info: forexforums.org Statistics for project forexforums.org etracker® web controlling instead of log file analysis

All times are GMT. The time now is 12:22 PM.
Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.