Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Text.cs to handle StringEval in arg0 #1131

Merged
merged 3 commits into from
Jul 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions main/SS/Formula/Functions/Text/Text.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ public class Text : Fixed2ArgFunction
public static DataFormatter Formatter = new DataFormatter();
public override ValueEval Evaluate(int srcRowIndex, int srcColumnIndex, ValueEval arg0, ValueEval arg1)
{
double s0;
if (arg0 is StringEval) return arg0;

double s0;
String s1;
try
{
Expand Down Expand Up @@ -130,4 +132,4 @@ public override ValueEval Evaluate(int srcRowIndex, int srcColumnIndex, ValueEva
// }
//}
}
}
}
2 changes: 1 addition & 1 deletion testcases/main/SS/Formula/Functions/TestText.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public void TestTextWithStringFirstArg()
ValueEval formatArg = new StringEval("abc");
ValueEval[] args = { strArg, formatArg };
ValueEval result = TextFunction.TEXT.Evaluate(args, -1, (short)-1);
Assert.AreEqual(ErrorEval.VALUE_INVALID, result);
Assert.AreEqual(strArg, result);
}
[Test]
public void TestTextWithDeciamlFormatSecondArg()
Expand Down
Loading