public string GetHtml(object obj) { string result = ""; System.Text.RegularExpressions.Regex regex = new System.Text.RegularExpressions.Regex("{.*,.*,.*}"); string matchResult = regex.Match(obj.ToString()).ToString(); if (string.IsNullOrEmpty(matchResult)) { result = obj.ToString(); } else { string[] strs = matchResult.Replace("{", "").Replace("}", "").Split(','); result = "<table style=\"padding:0px;margin:0px;line-height: 4px;border:none;border-width:0px;\"><tr>"; result += "<td style=\"padding:0px;margin:0px;text-align: right;width:50%; line-height: 10px;border:none;border-width:0px;\" rowspan=\"2\"><span>" + strs[0] + "</span></td>"; result += "<td style=\"padding:0px;margin:0px;text-align: left; line-height: 10px;border:none;border-width:0px;\"><span style=\"vertical-align:super; color:red; font-size:9px; font-family:Arial, Helvetica, sans-serif;margin:10px 0px 0px 0px\">" + strs[1] + "</span></td></tr>"; result += "<tr><td style=\"padding:0px;margin:0px;text-align: left;line-height: 10px;border:none;border-width:0px;\"><span style=\"vertical-align:sub; color:red; font-size:9px; font-family:Arial, Helvetica, sans-serif;margin:10px 0px 0px 0px\">" + strs[2] + "</span></td></tr></table>"; } return result; }
上記のコードは主に 3 つの値を取得するためのものです、 strs[0]=759 strs[1]=+0.6 strs[0]=-0.4 これは上下を表示するために使用されます
??
??