### Summary

NumToJText ( number ; 3 ; 0 ) gives incorrect result with 1 and 0

### Product

FileMaker Pro

### Version

11 and 12

### Operating system version

windows

### Description of the issue

I was searching a way to insert a character between each digit of a number, without a recursive custom function or a script.

The idea was to use the NumToJText ( ) function with 3 as separator parameter.

But it doesn't work correctly when there is one or more 1 and 0.

For example:

NumToJText ( 234 ; 3 ; 0 ) returns: 2百3十4

NumToJText ( 123456789 ; 3 ; 0 ) returns: 1億2千3百4十5万6千7百8十9

but:

NumToJText ( 134 ; 3 ; 0 ) returns: 百3十4

NumToJText ( 111 ; 3 ; 0 ) returns: 百十1

NumToJText ( 100 ; 3 ; 0 ) returns: 百

NumToJText ( 11111 ; 3 ; 0 ) returns: 1万千百十1

Is it a bug ?

raybaudi:

Thank you for the post.

As best I can tell, the NumToJText function is behaving exactly as expected; however, if I understand the goal correctly, you want a separator character to be inserted between each number in a string within a number field?

Would the following auto-enter calculation on the number field suffice?

Substitute ( Substitute ( Substitute ( Substitute ( Substitute ( Substitute ( Substitute ( Substitute ( Substitute ( Substitute ( Self ; "1" ; "1#" ) ; "2" ; "2#" ) ; "3" ; "3#" ) ; "4" ; "4#" ) ; "5" ; "5#" ) ; "6" ; "6#" ) ; "7" ; "7#" ) ; "8" ; "8#" ) ; "9" ; "9#" ) ; "0" ; "0#" )

This will take a number string of any length and insert a "#" between each number. Any symbol can be used instead in place of the "#", and if desired, this is easily modified so different symbols follow different numbers.

TSFalcon

FileMaker, Inc.