15位银行卡号格式为0000-000000-00000 [1] 。
如果我显示最后4位数字,它会变成xxxx-xxxxxx-x0000,看起来有点傻。
是否有正确的方法来格式化屏蔽的15位数字?
(我希望我们不会显示超过最后4个,但如果有标准,我想了解它。)
15 digit bank card numbers are formatted 0000-000000-00000[1].
If I show the last 4 digits, it becomes xxxx-xxxxxx-x0000 which looks slightly goofy.
Is there a correct way to format a masked 15 digit number?
(I expect we will not show more than the last 4 anyway, but if there is a standard, I want to know about it.)
最满意答案
真的没有标准。 绝大多数网站都显示最后四个,前面有四个X,无论信用卡号是15还是16位,这可能是您用户最容易识别的。 但是如果你真的想要格式化它以便显示卡片编号的实际结构,那么尽管有愚蠢的行为,它仍然是xxxx-xxxxxx-x0000 。 用户可能会发现显示一个额外的字符( xxxx-xxxxxx-00000 )是“不安全的”,我相信你不想让任何人有机会投诉或退款。
There is no standard really. The vast majority of sites display the last four with four X's in front them whether the credit card number is 15 or 16 digits so that would probably be the most recognizable to your users. But if you really want to format it so you show the actual structure of the card number then do it as xxxx-xxxxxx-x0000 despite the goofiness. Users may find showing an extra character (xxxx-xxxxxx-00000) is "unsafe" and I'm sure you don't want to give anyone an opportunity to complain or do a chargeback.
更多推荐
发布评论