private String GetQuoted(XLFormula formula) { String value = formula.Value; Double num; if ((!Double.TryParse(value, out num) && !formula.IsFormula) && value[0] != '\"' && !value.EndsWith("\"")) return String.Format("\"{0}\"", value.Replace("\"", "\"\"")); return value; }
private String GetQuoted(XLFormula formula) { String value = formula.Value; if ((!Double.TryParse(value, out double num) && !formula.IsFormula) && value[0] != '\"' && !value.EndsWith("\"")) { return(String.Format("\"{0}\"", value.Replace("\"", "\"\""))); } return(value); }
private String GetQuoted(XLFormula formula) { String value = formula.Value; if (formula.IsFormula || value.StartsWith("\"") && value.EndsWith("\"") || Double.TryParse(value, XLHelper.NumberStyle, XLHelper.ParseCulture, out double num)) { return(value); } return(String.Format("\"{0}\"", value.Replace("\"", "\"\""))); }
internal void AdjustFormulas(XLCell baseCell, XLCell targetCell) { var keys = Values.Keys.ToList(); foreach (var key in keys) { if (Values[key] == null || !Values[key].IsFormula) { continue; } var r1c1 = baseCell.GetFormulaR1C1(Values[key].Value); Values[key] = new XLFormula { _value = targetCell.GetFormulaA1(r1c1), IsFormula = true }; } }
public XLFormula(XLFormula defaultFormula) { _value = defaultFormula._value; IsFormula = defaultFormula.IsFormula; }