简体   繁体   English

数据表中的科学计数法值

[英]Scientific notation values in datatable

I have a datatable that gets populated with excel.The datatable does not have fixed columns as it depends on the excel provided by the client. 我有一个填充有excel的数据表。该数据表没有固定的列,因为它取决于客户端提供的excel。 While reading excel to datatable, the decimal values are getting converted to scientific notation values. 在将excel读取到数据表时,十进制值将转换为科学计数法值。 I do not want to save these values in database as scientific notation but as decimals. 我不想将这些值以科学计数形式保存在数据库中,而是以小数形式保存。 I know I can convert a scientific notion value to decimal but how to find out the column of datatable that contains scientific values as columns of datatable depends on the excel provided. 我知道我可以将科学概念值转换为十进制,但是如何找出包含科学值的数据表列作为数据表列取决于所提供的Excel。

When you read in the data from excel, you can try to convert number from each column by using 当您从excel读取数据时,可以尝试使用

bool result = Decimal.TryParse(number_in_string)

A succesful returned result means the scientific notation is parsed. 成功的返回结果意味着对科学符号进行了解析。 You can use this to see which column contains the scientific notation. 您可以使用它来查看哪个列包含科学计数法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM