Strip Leading Zeros
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Strip Leading Zeros
What is the easiest way to strip leading zeros from a numeric field?
ie. 00009 should be 9
Thanks for any help!
Warren
ie. 00009 should be 9
Thanks for any help!
Warren
-
- VIP Livecode Opensource Backer
- Posts: 10043
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Hmmm...apparently adding zero works pretty quickly:
put 0+000009
put 0+000009
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
I was watching this thread hoping that it would answer a question I've been trying to answer myself. How do you actually apply input validation/input aids in Runtime Revolution?
In Javascript if I wanted to change the contents of an input field to all upper case I would put this in the field tags.
onChange = "toupper(this)"
and this elsewhere on my html page.
<script type = "text/javascript" language ="javascript">
function toupper(myObject){
myObject.value = myObject.value.toUpperCase();
}
</script>
Lets say I rewrote that in Transcript how would I apply it to a field and what would I use to trigger the function?
Many thanks
Phil
In Javascript if I wanted to change the contents of an input field to all upper case I would put this in the field tags.
onChange = "toupper(this)"
and this elsewhere on my html page.
<script type = "text/javascript" language ="javascript">
function toupper(myObject){
myObject.value = myObject.value.toUpperCase();
}
</script>
Lets say I rewrote that in Transcript how would I apply it to a field and what would I use to trigger the function?
Many thanks
Phil
Put this in the field's scriptPhilhold wrote: how would I apply it to a field and what would I use to trigger the function?
Code: Select all
ON closeField
put toupper(me) into me
END closeField
Hank