So - for numeric values Coda only accepts “.” as a decimal separator. I’m from a part of the world (Denmark) where we use “,” as a decimal separator and “.” as a thousand separator.
How do I prevent users from entering “,” as a decimal separator for numeric values? Coda accepts whatever I input. It does, however, highlight the cell - but a user could potentially miss this. Also aggregate functions won’t work if there’s a non numeric value in a given cell.
Any suggestions would be greatly appreciated, thank you.
I hear you, I am from Belgium; there is no solution yet and I am not even sure if they have a road map that contains this subject.
I import on a regular basis local data and data contains a comma. I use a button to ModifyRows() and replace the comma with a a dot. It is not ideal, but it works.
@Christiaan_Huizer
Ha a Belgian here :), I feel less alone now.
But indeed, the only way is to add in your number column a formula that replaces according to your preferences.
There are some hacks you can use. None of them are ideals but it may work for your case.
You can “sweep the dirt under the rug”:
You would create a hidden column with a formula like this If(RegexMatch(ThisRow.ValueColumn, ",", RegexReplace( ThisRow.ValueColumn, "," , "." ), ThisRow.ValueColumn)
Then you use the hidden column for all the calculation
You can create an automation to validate the date.
Table
.FormulaMap(
SwitchIf(
Value.IsNumber().Not(),
Notify(
User, Format("{1} has an invalid data", CurrentValue)
)
)
)
You can force the user to press a button every time he enters data. You can disable the button if the data is not validated.
I’m not super familiar with how Coda currently handles numbers with commas. I guess 23,45 is treated as a string but 1.000 is treated as an integer, 1?
In theory if your column type formula took a string as input, Coda should interpret 1.000 as a string, and then we could convert it to the number 1000 in the Pack.
I guess this would just work for ingesting number format strings of 1.234,56, and returning numbers (1234.56). You wouldn’t want it to go the other way (display the number 1234.56 as 1.234,56, because we would have to return the 1.234,56 as a string and you wouldn’t be able to then do math with it).