Adobe Community
All community
This category
This board
Knowledge base
Users
cancel
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results forÂ
ShowÂ
 onlyÂ
|
Search instead forÂ
Did you mean:Â
Global community
Language:
Deutsch
English
Español
Français
Português
日本語コミュニティ
Dedicated community for Japanese speakers
í•œêµ ì»¤ë®¤ë‹ˆí‹°
Dedicated community for Korean speakers
Sign In
Exit
Home
Animate
Discussions
Re: decimal part
Home
Animate
Discussions
Re: decimal part
0
Upvote
decimal part
jucasan
New Here
,
/t5/animate-discussions/decimal-part/td-p/102207
Aug 28, 2008
Aug 28, 2008
Copy link to clipboard
Copied
if I have this number (or a var) but I only want to keep what is left after the period for example:
1.28 want to keep only .28
23.43 =>.43
45.00=>.00
how do I do that?
Thanks
TOPICS
ActionScript
Views
531
Translate
Translate
Report
Report
Follow
Report
More
Reply
Reply
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
6 Replies
6
Jump to latest reply
Guest
/t5/animate-discussions/decimal-part/m-p/102208#M1828
Aug 29, 2008
Aug 29, 2008
Copy link to clipboard
Copied
If formatting is not an object, you might use this:
Votes
0
Upvote
Translate
Translate
Report
Report
Follow
Report
More
Reply
Reply
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Guest
/t5/animate-discussions/decimal-part/m-p/102209#M1829
Aug 29, 2008
Aug 29, 2008
Copy link to clipboard
Copied
var valStr:String = String(23.43);
trace(valStr.substr(valStr.indexOf(".")));
// return .43
trace(valStr.substr(valStr.indexOf(".")+1));
// return 43
use this code.
Votes
0
Upvote
Translate
Translate
Report
Report
Follow
Report
More
Reply
Reply
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
_pixel_chick
New Here
,
/t5/animate-discussions/decimal-part/m-p/102210#M1830
Oct 16, 2008
Oct 16, 2008
Copy link to clipboard
Copied
In Response To Deleted User
What if I have a number like this .2006164410284421208 and I want to display it as 20.06. I know if I do (Math.round(Percentage*100)) I get 20, but how do I get the 2 numbers after the decimal point?
Votes
0
Upvote
Translate
Translate
Report
Report
Follow
Report
More
Reply
Reply
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Newsgroup_User
LEGEND
,
/t5/animate-discussions/decimal-part/m-p/102211#M1831
Oct 16, 2008
Oct 16, 2008
Copy link to clipboard
Copied
In Response To Deleted User
(Percentage*100).toFixed(2)
Votes
0
Upvote
Translate
Translate
Report
Report
Follow
Report
More
Reply
Reply
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
_pixel_chick
New Here
,
/t5/animate-discussions/decimal-part/m-p/102213#M1833
Oct 16, 2008
Oct 16, 2008
Copy link to clipboard
Copied
LATEST
In Response To Newsgroup_User
Perfect! Thank you!
Votes
0
Upvote
Translate
Translate
Report
Report
Follow
Report
More
Reply
Reply
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Colin Holgate
LEGEND
,
/t5/animate-discussions/decimal-part/m-p/102212#M1832
Oct 16, 2008
Oct 16, 2008
Copy link to clipboard
Copied
var n:Number=12345.67890;
trace(Math.floor((n-Math.floor(n))*100)/100);
would give 0.67
Votes
0
Upvote
Translate
Translate
Report
Report
Follow
Report
More
Reply
Reply
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Post Reply
Preview
Exit Preview
never-displayed
You must be signed in to add attachments
never-displayed
Â
Resources
Learn
Get started with Adobe Animate guide
Quick guide for keyboard shortcuts
How to make an ad for Adwords in Animate CC?
Drawing in Animate
Latest Features
What's New in Adobe Animate?