How to check if variable is Integer
By Sergey - Posted on February 12th, 2008
FoxPro doesn't provide a direct way to check if variable is integer or how many digits it has after decimal point but it can be accomplished using PADL() function.
| This is sample code. Add error handling and adjust to your requirements as necessary. |
lnValue = 1.000 && Is Variable integer? ? NOT ( SET("Point") $ PADL(lnValue,20) ) && How many digits after decimal point? ? -AT(SET("Point"), PADL(m.lnNumber,20)) % 20
Recent comments
4 days 10 hours ago
1 week 1 day ago
1 week 1 day ago
1 week 4 days ago
1 week 4 days ago
2 weeks 5 days ago
2 weeks 5 days ago
3 weeks 1 day ago
3 weeks 1 day ago
3 weeks 3 days ago