# Adding a percentage symbol in field

**URL:** <https://forum.kirupa.com/t/adding-a-percentage-symbol-in-field/63836>\
**Category:** Uncategorized\
**Created:** [September 10, 2004, 12:51pm UTC](https://forum.kirupa.com/t/adding-a-percentage-symbol-in-field/63836 "2004-09-10T12:51:36Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![w9914420](https://avatars.discourse-cdn.com/v4/letter/w/c0e974/32.png) [@w9914420](https://forum.kirupa.com/u/w9914420)\
**Post date:** [September 10, 2004, 12:51pm UTC](https://forum.kirupa.com/t/adding-a-percentage-symbol-in-field/63836/1 "2004-09-10T12:51:36Z")

</div>

ok i have created a simple enough preloader, all i am wanting to do is add  
a percentage symbol to the text field called “frame” my code is below

loadedbytes = getBytesLoaded();  
totalbytes = getBytesTotal();  
loadedkbytes = Math.ceil(loadedbytes/1000);  
totalkbytes = Math.ceil(totalbytes/1000);  
if (loadedbytes == totalbytes) {  
gotoAndStop(“Scene 1”, 4);  
}  
frame = int(loadedbytes/(totalbytes/100));  
tellTarget (\_root.mainloader.loader) {  
tellTarget (\_root.faker) {  
}  
gotoAndStop (\_root.frame);  
}  
\_root.mainloader.loader.place.test = frame

If may sound like a dumb question when i can just add a percentage symbol on the stage. but I would much prefer to add it as code in the text field.  
any help appreciated.

kind regards

w9914420

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 10, 2004, 1:03pm UTC](https://forum.kirupa.com/t/adding-a-percentage-symbol-in-field/63836/2 "2004-09-10T13:03:37Z")

</div>

frame = int(loadedbytes/(totalbytes/100) + “%”);

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 10, 2004, 1:06pm UTC](https://forum.kirupa.com/t/adding-a-percentage-symbol-in-field/63836/3 "2004-09-10T13:06:47Z")

</div>

root.mainloader.loader.place.test = frame+"%"

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 10, 2004, 1:13pm UTC](https://forum.kirupa.com/t/adding-a-percentage-symbol-in-field/63836/4 "2004-09-10T13:13:23Z")

</div>

thanks guys 🙂

kenny thanks mate but i tried your code and the result was that the frame field failed to work.

eki your code worked like a charm

thanks again guys, i really appreciate this

kind regards

w9914420

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 10, 2004, 2:49pm UTC](https://forum.kirupa.com/t/adding-a-percentage-symbol-in-field/63836/5 "2004-09-10T14:49:46Z")

</div>

Sorry, man. I should have looked at all of your code.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 10, 2004, 2:51pm UTC](https://forum.kirupa.com/t/adding-a-percentage-symbol-in-field/63836/6 "2004-09-10T14:51:18Z")

</div>

any time
