This repository has been archived by the owner on Jan 25, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated the project to change set#67eadd18f55a.
- Loading branch information
Showing
12 changed files
with
147 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
75 changes: 75 additions & 0 deletions
75
src/EPPlus.Core/FormulaParsing/Excel/Functions/ExcelDoubleCellValue.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
|
||
namespace OfficeOpenXml.FormulaParsing.Excel.Functions | ||
{ | ||
public struct ExcelDoubleCellValue : IComparable<ExcelDoubleCellValue>, IComparable | ||
{ | ||
public ExcelDoubleCellValue(double val) | ||
{ | ||
Value = val; | ||
CellRow = default(int?); | ||
} | ||
|
||
public ExcelDoubleCellValue(double val, int cellRow) | ||
{ | ||
Value = val; | ||
CellRow = cellRow; | ||
} | ||
|
||
public int? CellRow; | ||
|
||
public double Value; | ||
|
||
public static implicit operator double(ExcelDoubleCellValue d) | ||
{ | ||
return d.Value; | ||
} | ||
// User-defined conversion from double to Digit | ||
public static implicit operator ExcelDoubleCellValue(double d) | ||
{ | ||
return new ExcelDoubleCellValue(d); | ||
} | ||
|
||
public int CompareTo(ExcelDoubleCellValue other) | ||
{ | ||
return Value.CompareTo(other.Value); | ||
} | ||
|
||
public int CompareTo(object obj) | ||
{ | ||
if(obj is double) | ||
{ | ||
return Value.CompareTo((double)obj); | ||
} | ||
return Value.CompareTo(((ExcelDoubleCellValue)obj).Value); | ||
} | ||
|
||
public override bool Equals(object obj) | ||
{ | ||
return CompareTo(obj) == 0; | ||
} | ||
|
||
public static bool operator ==(ExcelDoubleCellValue a, ExcelDoubleCellValue b) | ||
{ | ||
return a.Value.CompareTo(b.Value) == 0; | ||
} | ||
|
||
public static bool operator ==(ExcelDoubleCellValue a, double b) | ||
{ | ||
return a.Value.CompareTo(b) == 0; | ||
} | ||
|
||
public static bool operator !=(ExcelDoubleCellValue a, ExcelDoubleCellValue b) | ||
{ | ||
return a.Value.CompareTo(b.Value) != 0; | ||
} | ||
|
||
public static bool operator !=(ExcelDoubleCellValue a, double b) | ||
{ | ||
return a.Value.CompareTo(b) != 0; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"version": "1.1.0-*", | ||
"version": "1.2.0-*", | ||
|
||
"authors": [ "Vahid Nasiri" ], | ||
"packOptions": { | ||
|