MarketFactory C# API 3.0
MFDecimal Class Reference

A thin immutable wrapper for a floating point number. More...

Inheritance diagram for MFDecimal:

Public Member Functions

 MFDecimal (string s)
 Constructor which accepts a string value. More...
 
MFDecimal abs ()
 Absolute value. More...
 
int CompareTo (Object o)
 Implements Comparable method compareTo. More...
 
bool Equals (MFDecimal o)
 Comparison operator: equal. More...
 
bool gt (MFDecimal o)
 Comparison operator: greater-than. More...
 
bool gte (MFDecimal o)
 Comparison operator: greater-than or equal. More...
 
bool lt (MFDecimal o)
 Comparison operator: less-than. More...
 
bool lte (MFDecimal o)
 Comparison operator: less-than or equal. More...
 
MFDecimal neg ()
 Negate value. More...
 
double toDouble ()
 Convert the value. More...
 
long toLong ()
 Convert the value. More...
 
override string ToString ()
 Provide access to the raw value. More...
 

Static Public Member Functions

static bool isValid (MFDecimal o)
 Check if MFDecimal object has valid value. More...
 
static MFDecimal valueOf (string s)
 Returns a MFDecimal object for the given representation of a FP number. More...
 
static MFDecimal valueOf (decimal num)
 Returns a MFDecimal object for the given representation of a FP number. More...
 
static MFDecimal valueOf (double num)
 Returns a MFDecimal object for the given representation of a FP number. More...
 
static MFDecimal valueOf (long num)
 Returns a MFDecimal object for the given representation of a FP number. More...
 

Static Public Attributes

static MFDecimal NA = new MFDecimal("NA")
 Special value: Not Applicable. More...
 
static MFDecimal NDA = new MFDecimal("NDA")
 Special value: No Data Available. More...
 
static MFDecimal NMA = new MFDecimal("NMA")
 Special value: No Market Available. More...
 
static MFDecimal ZERO = new MFDecimal("0")
 Special value: Zero (as a convenience). More...
 

Detailed Description

A thin immutable wrapper for a floating point number.

Must be 15 digits or less.

Constructor & Destructor Documentation

◆ MFDecimal()

MFDecimal ( string  s)

Constructor which accepts a string value.

Member Function Documentation

◆ valueOf() [1/4]

static MFDecimal valueOf ( string  s)
static

Returns a MFDecimal object for the given representation of a FP number.

◆ valueOf() [2/4]

static MFDecimal valueOf ( decimal  num)
static

Returns a MFDecimal object for the given representation of a FP number.

◆ valueOf() [3/4]

static MFDecimal valueOf ( double  num)
static

Returns a MFDecimal object for the given representation of a FP number.

◆ valueOf() [4/4]

static MFDecimal valueOf ( long  num)
static

Returns a MFDecimal object for the given representation of a FP number.

◆ toLong()

long toLong ( )

Convert the value.

Will throw NotSupportedException if not valid. Will throw FormatException if value is out of range.

◆ toDouble()

double toDouble ( )

Convert the value.

Will throw NotSupportedException if not valid.

◆ ToString()

override string ToString ( )

Provide access to the raw value.

◆ Equals()

bool Equals ( MFDecimal  o)

Comparison operator: equal.

◆ lte()

bool lte ( MFDecimal  o)

Comparison operator: less-than or equal.

Will throw NotSupportedException if either of the objects is not valid.

◆ gte()

bool gte ( MFDecimal  o)

Comparison operator: greater-than or equal.

Will throw NotSupportedException if either of the objects is not valid.

◆ lt()

bool lt ( MFDecimal  o)

Comparison operator: less-than.

Will throw NotSupportedException if either of the objects is not valid.

◆ gt()

bool gt ( MFDecimal  o)

Comparison operator: greater-than.

Will throw NotSupportedException if either of the objects is not valid.

◆ neg()

MFDecimal neg ( )

Negate value.

◆ abs()

MFDecimal abs ( )

Absolute value.

◆ CompareTo()

int CompareTo ( Object  o)

Implements Comparable method compareTo.

◆ isValid()

static bool isValid ( MFDecimal  o)
static

Check if MFDecimal object has valid value.

Member Data Documentation

◆ NMA

MFDecimal NMA = new MFDecimal("NMA")
static

Special value: No Market Available.

◆ NDA

MFDecimal NDA = new MFDecimal("NDA")
static

Special value: No Data Available.

◆ NA

MFDecimal NA = new MFDecimal("NA")
static

Special value: Not Applicable.

◆ ZERO

MFDecimal ZERO = new MFDecimal("0")
static

Special value: Zero (as a convenience).

Confidential. Copyright © 2011 MarketFactory, Inc.