Vinians2006 Active Member Licensed User Longtime User Mar 14, 2012 #1 See : Code: dim str as string str = "0" MsgBox(NumberFormat(str, 4, 0)) The MsgBox shows: 0,00 ????? Its should be 0000 ... Whats wrong ? I know that str is a string but B4A convert it on the fly...
See : Code: dim str as string str = "0" MsgBox(NumberFormat(str, 4, 0)) The MsgBox shows: 0,00 ????? Its should be 0000 ... Whats wrong ? I know that str is a string but B4A convert it on the fly...
klaus Expert Licensed User Longtime User Mar 14, 2012 #2 NumberFormat transforms a NUMBER to a STRING not a String to a String. Best regards. Upvote 0
Vinians2006 Active Member Licensed User Longtime User Mar 14, 2012 #3 klaus said: NumberFormat transforms a NUMBER to a STRING not a String to a String. Best regards. Click to expand... I know but since NumberFormat requires a integer Basic4A transform it on the fly. Its only a snippet of code, after you help me on another thread I used NumberFormat several times only in this line the result is wrong... Upvote 0
klaus said: NumberFormat transforms a NUMBER to a STRING not a String to a String. Best regards. Click to expand... I know but since NumberFormat requires a integer Basic4A transform it on the fly. Its only a snippet of code, after you help me on another thread I used NumberFormat several times only in this line the result is wrong...
NJDude Expert Licensed User Longtime User Mar 14, 2012 #4 Try this then: Code: Msgbox(NumberFormat2(str, 4, 0, 0, False), "") Upvote 0
Vinians2006 Active Member Licensed User Longtime User Mar 14, 2012 #5 Ok, but its a bug. How can I send it to Erel for fix? Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Mar 15, 2012 #6 Bugs should be posted in the bugs sub-forum. However I'm not sure that I understand the problem. It displays 0,000 because of the grouping separator. You should use NumberFormat2 if you want to disable it. Upvote 0
Bugs should be posted in the bugs sub-forum. However I'm not sure that I understand the problem. It displays 0,000 because of the grouping separator. You should use NumberFormat2 if you want to disable it.