问题描述
我正在寻找以下问题的提示或提示.
我有一个文本框.用户只能插入数字,我想将输入转换为货币值
例如:
用户插入564
然后tb将其转换为某种形式:€5,64
或:
用户插入65
-> tb转换为:€0,65
或
输入:456125
->转换:€4.561,25
我的问题是写方向:我希望用户从右到左写,所以您首先写"4",光标跳到行的右端,而不是写5,依此类推.
我已经尝试过很多带有mask的maskedTextBox之类的东西:
$#,###,###.#0
或
$ ###.##
等等
我也尝试过
string.format("{0:c}");
但是在这里,当我插入例如15354时,结果如下:15.354,00€
我想要,"后的最后2位数字,
我希望你了解我的问题在哪里.我还没有完成代码,只是一个提示之类的东西.
Hi,
I''m looking for a tip or hint for the following problem.
I have a Textbox. The user can only insert digits and i want to transform the input to a currency value
e.g.:
The user inserts 564
and the tb converts it into some kind of: € 5,64
or:
the users inserts 65
-> tb converts it into: € 0,65
or
input: 456125
-> convert: € 4.561,25
my problem is the write direction: i want the user to write right to left, so you first write the "4", the cursor jumps to the right end of line, than you write the 5 and so on
I''ve tried many thing like maskedTextBox with mask:
$ #,###,###.#0
or
$ ###.##
and so on
i''ve also tried
string.format("{0:c}");
But here i get, when i insert for example 15354 this result : 15.354,00 €
i want the last 2 digits behind the ","
i hope you understood where''s my problem. I don''t a finished code, just a hint or something..
Thanks in advance!
推荐答案
这篇关于文本框将输入转换为货币值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!