So for 1234567890 you need to add more hashtags:
P.S.: And that solution adds spaces from left side if number is smaller.
FormatFloat is meant to have the ThousandSeparator symbol (',') in the format mask: When this symbol is found the integer digits are grouped by three and separated by the Decimalseparator of the FormatSettings:
FormatFloat('#,##0', 1234567890) ---> '1,234,567,890' (when FormatSettings.ThousandSeparator = ',')
FormatFloat('#,##0', 1234567890) ---> '1 234 567 890' (when FormatSettings.ThousandSeparator = ' ')
FormatFloat('#,##0.0', 1234567890.123) ---> '1.234.567.890,1' (when FormatSettings.ThousandSeparator = '.' and .Decimalseparator = ',')
There is no need to have several '#' symbols, in fact FormatFloat(',#', 1234567890) has the same output as the first example above, and FormatFloat(',.0', 1234567890.123) as the last example.
But I am not sure whether this has any relevance to the OP's issue. I do not understand that 'N' inside the format string.