是否有Visual C#方法来帮助解析奇怪的货币字符串? [英] Are there Visual C# methods to help parse weird monetary strings?

查看:100
本文介绍了是否有Visual C#方法来帮助解析奇怪的货币字符串?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个使用第三方csv文件作为输入并将各种值分配给字符串的应用程序。美元金额采用以下格式。 。



如果货币金额是负数,例如,($ 7685)



如果单数金额为正数,为$ 7685



我需要转换为双精度(用于计算)。在我开始尝试解析和转换之前,有没有什么方法可以让我的生活更容易解析/转换?



我感谢所有建议。

I'm working on an app that uses a 3rd party csv file as input and assigned the various values to strings. The dollar amounts are in the following format . .

if a monetary amount is a negative it is, for example, ($7685)

if the monitary amount is a positive, it is $7685

I will need to convert to a double (to use in calculations). Before I start trying to parse this and convert, are there any methods that would make my life easier in parsing/converting this?

I appreciate all suggestions.

推荐答案

7685)



如果单一金额为正数,则为
7685)

if the monitary amount is a positive, it is


7685



我需要转换为双(用于计算)。在我开始尝试解析和转换之前,有没有什么方法可以让我的生活更容易解析/转换?



我感谢所有建议。
7685

I will need to convert to a double (to use in calculations). Before I start trying to parse this and convert, are there any methods that would make my life easier in parsing/converting this?

I appreciate all suggestions.


您可能需要删除'


这篇关于是否有Visual C#方法来帮助解析奇怪的货币字符串?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆