数字到字符串并反向转换 [英] Number to string and back conversion

查看:86
本文介绍了数字到字符串并反向转换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要一些有关.net代码的帮助.我将一个来自Access数据库字段的数字带到表单上的文本框中,并将其格式化为货币格式,这样它将显示$和正确的逗号位置以及两个小数点.

I need some help with some .net code. I''m bringing a number from a access database field in to a textbox on a form and formating it as currency so it will display the $ and proper comma placement and two decimal points.

editClaim_Amount.Text=Format(dsEnterData.Tables(0).Rows(0).Item("Claim_Amount", "c")



这部分很好-现在我需要能够将该文本保存回原始格式.

示例:输入23468
显示:$ 23,468.00
节省:23468

看起来很简单,但是我被困住了.我可以删掉$和.00,但不能删掉逗号.有没有一种简单的方法可以取消格式化"?

预先感谢您的任何帮助

Craig



That part is good - now I need to be able to save that text back to its origanal format.

Example: Input 23468
Display:$23,468.00
Ssave:23468

It seems simple but I''m stuck. I can trim off the $ and .00 but not the comma(s). Is there a straightforward way to "unformat"?

Thanks in advance for any help

Craig

推荐答案

以及正确的逗号位置和两个小数点.

and proper comma placement and two decimal points.

editClaim_Amount.Text=Format(dsEnterData.Tables(0).Rows(0).Item("Claim_Amount", "c")



这部分很好-现在我需要能够将该文本保存回原始格式.

示例:输入23468
显示:



That part is good - now I need to be able to save that text back to its origanal format.

Example: Input 23468
Display:


23,468.00
节省:23468

看起来很简单,但是我被困住了.我可以剪掉
23,468.00
Ssave:23468

It seems simple but I''m stuck. I can trim off the


和.00,但不能剪掉逗号.有没有一种简单的方法可以取消格式化"?

预先感谢您的任何帮助

克雷格(Craig)
and .00 but not the comma(s). Is there a straightforward way to "unformat"?

Thanks in advance for any help

Craig


这篇关于数字到字符串并反向转换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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