This commit is contained in:
parent
7b685cf220
commit
7fec1e61b4
@ -778,12 +778,9 @@ namespace VEPROMS.CSLA.Library
|
||||
#region FortranFormat
|
||||
public static string ConvertFortranFormatToScienctificNotation(string str)
|
||||
{
|
||||
// Convert E style numbers to RTF with \super and \nosupersub
|
||||
string retval = Regex.Replace(str, "([+-]?)([0-9]+)[.]([0-9]*?)0*E([+-]?[0-9]+)", new MatchEvaluator(FixFortranNumber));
|
||||
//retval = Regex.Replace(retval, "[#](.*?)[#]", "\\super $1\\nosupersub ");// DOS Superscript
|
||||
//retval = Regex.Replace(retval, "[~](.*?)[~]", "\\sub $1\\nosupersub ");// DOS Subscript
|
||||
retval = Regex.Replace(retval, "[#](.*?)[#]", "\\up3 $1\\up0 ");// DOS Superscript
|
||||
retval = Regex.Replace(retval, "[~](.*?)[~]", "\\dn3 $1\\dn0 ");// DOS Subscript
|
||||
retval = Regex.Replace(retval, "[#](.*?)[#]", "\\up2 $1\\up0 ");// DOS Superscript
|
||||
retval = Regex.Replace(retval, "[~](.*?)[~]", "\\dn2 $1\\dn0 ");// DOS Subscript
|
||||
return retval;
|
||||
}
|
||||
private static string FixFortranNumber(Match match)
|
||||
@ -797,7 +794,7 @@ namespace VEPROMS.CSLA.Library
|
||||
else // A number with a decimal point
|
||||
sb.Append(match.Groups[2].Value + "." + match.Groups[3].Value + "x10");
|
||||
// Add the exponent as superscript
|
||||
return sb.ToString() + "\\up3 " + match.Groups[4].Value + "\\up0 ";
|
||||
return sb.ToString() + "\\up2 " + match.Groups[4].Value + "\\up0 ";
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user