| View previous topic :: View next topic |
| Author |
Message |
rayman Voice
Joined: 18 Nov 2005 Posts: 4 Location: Germany
|
Posted: Fri Nov 18, 2005 8:00 am Post subject: Decimal point |
|
|
Hello,
I would like to use the function
| Code: | | string is double $sometest |
for checking, if $sometext is double.
The problem is, that we use in Germany the comma (,) as the decimal point.
Therefore
| Code: |
set sometext "7,44"
string is double $sometext
|
returns false. Can I tell TCL to have a different decimal point?
Thanks in advance
rayman |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Fri Nov 18, 2005 8:33 am Post subject: |
|
|
| Code: | | set double [string map {, .} $double] |
and the , is replaced by a . so you can apply [string is double] on it. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
rayman Voice
Joined: 18 Nov 2005 Posts: 4 Location: Germany
|
Posted: Fri Nov 18, 2005 9:34 am Post subject: |
|
|
Thanks, it works fine  |
|
| Back to top |
|
 |
|