Skip to main content
fzl_rshd
Inspiring
Mar 26, 2023 9:31 AM UTC
Answered

Can anyone to remove a comma after a number?

example:

var nmb:Number = 12.3;

// i wanna change from 12.3 to 12 instead
This topic is closed to new replies. Start a new post to keep the conversation going.
Vladin M. Mitov
Vladin M. MitovCorrect answer
Inspiring
Mar 26, 2023 10:06 AM UTC

 

var nmb:Number = 12.3;
var str:String = nmb.toFixed(0);
trace( str );     // 12

 

 

- Vlad: UX and graphic design, Flash user since 1998Member of Flanimate Power Tools team - extensions for character animation

6 replies

JoãoCésar17023019
Community Expert
Community Expert
Mar 26, 2023 10:28 AM UTC

Hi.

 

If you want to keep it as a number:

var nmb:Number = 12.3;

nmb = int(nmb);

// or
// nmb = Math.floor(nmb);

 

Regards,

JC

Translate
Vladin M. Mitov
Vladin M. MitovCorrect answer
Inspiring
Mar 26, 2023 10:06 AM UTC

 

var nmb:Number = 12.3;
var str:String = nmb.toFixed(0);
trace( str );     // 12

 

 

Translate
- Vlad: UX and graphic design, Flash user since 1998Member of Flanimate Power Tools team - extensions for character animation
fzl_rshd
fzl_rshdAuthor
Inspiring
Mar 26, 2023 10:26 AM UTC

THANK YOOOOOUUU!!!!! :--)

Translate
kglad
Community Expert
Community Expert
Mar 26, 2023 1:50 PM UTC

that's all rounding.

Translate
kglad
Community Expert
Community Expert
Mar 26, 2023 9:39 AM UTC

do you want to round down?

Translate
fzl_rshd
fzl_rshdAuthor
Inspiring
Mar 26, 2023 9:43 AM UTC

No, I just wanna remove 12,3 to 12 instead of number

Translate