Return-Path: Received: from asbnvacz-mailrelay01.megapath.net ([207.145.128.243] verified) by media-motion.tv (CommuniGate Pro SMTP 4.2.10) with ESMTP id 5041041 for AE-List@media-motion.tv; Wed, 17 Apr 2013 06:33:49 +0200 Received: from mail3.sea5.speakeasy.net (mail3.sea5.speakeasy.net [69.17.117.42]) by asbnvacz-mailrelay01.megapath.net (Postfix) with ESMTP id 5F1071EE5162 for ; Wed, 17 Apr 2013 00:41:55 -0400 (EDT) Received: (qmail 17465 invoked from network); 17 Apr 2013 04:41:54 -0000 Received: by simscan 1.4.0 ppid: 12260, pid: 12649, t: 0.1880s scanners: clamav: 0.88.2/m:52/d:10739 spam: 3.0.4 Received: from c-67-185-28-214.hsd1.wa.comcast.net (HELO [192.168.1.125]) (albion@[67.185.28.214]) (envelope-sender ) by mail3.sea5.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 17 Apr 2013 04:41:54 -0000 From: James Culbertson Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Subject: expressions: limiting decimals and adding 0 to single digit integers? Date: Tue, 16 Apr 2013 21:41:10 -0700 Message-Id: To: After Effects Mail List Mime-Version: 1.0 (Apple Message framework v1283) X-Mailer: Apple Mail (2.1283) X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail3.sea5 X-Spam-Level: X-Spam-Status: No, score=0.0 required=8.0 tests=none autolearn=disabled version=3.0.4 I am linking one layers rotation to a text layers source text. How do I modify the simple expression to limit the decimal to two = places, and at the same time make all integers two digits so 0 - 9 are = 00, 01, 02,...? Something like this but that adds two decimal places to the number: //--Expression begins nums =3D thisComp.layer("shape").transform.rotation; amtOfZeroes =3D 2; //--Do not modify below this line isNeg =3D false; if(nums < 0) { nums =3D Math.abs( nums ); isNeg =3D true; } sVal =3D Math.round( nums ) + ""; while(sVal.length < amtOfZeroes) { sVal =3D "0" + sVal;=20 } if(isNeg) sVal =3D "-" + sVal; sVal //--Expression ends Thanks, James