• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Big number in a text caption

Contributor ,
Dec 06, 2018 Dec 06, 2018

Copy link to clipboard

Copied

...

Hello Captivaters !...

I'm starting to work with big numbers... I made a D&D slide in which I can put 1 000, 100, 10 or 1 blocks in a specific area.

And I have a variable which counts the number of cubes.

(Inspired by Paul Wilson's video : Drag and Drop Counting Game for Adobe Captivate 2019 - YouTube )

You can see this here :

GN_01.png

Everything seems to work fine but my problem is :

=> I want my number to be 3 110 (with a space after the 3 first digit) instead of 3110.

As I will want to work with millions, billions... this will be more and more difficult to read for my learners without the spaces...

So I need you help !!...

Many thanks in advance !...

...

Views

318

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Dec 06, 2018 Dec 06, 2018

Il vous faudra du JavaScript.

There is a function 'toLocaleString()' which you could use, but not sure it is supported by all browsers. Moreover it will take over the way numbers are displayed in your country. That is not always with a space, here we are using a point, in USA they are using a comma.....

Votes

Translate

Translate
Community Expert ,
Dec 06, 2018 Dec 06, 2018

Copy link to clipboard

Copied

Il vous faudra du JavaScript.

There is a function 'toLocaleString()' which you could use, but not sure it is supported by all browsers. Moreover it will take over the way numbers are displayed in your country. That is not always with a space, here we are using a point, in USA they are using a comma.....

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Dec 06, 2018 Dec 06, 2018

Copy link to clipboard

Copied

...

Thanks Lily !

But I don't know how to use this 'toLocaleString()'...

As my variable is called v_Total_01

I try (in a javascript window) this code :

var nombre = v_Total_01;

console.log(nombre.toLocaleString());

(I tried also with ""... with a c after the name...)

but without any success so far...

(As usual in fact everytime I tried to use javascript in captivate... )

...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Dec 06, 2018 Dec 06, 2018

Copy link to clipboard

Copied

...

Finally !...

GN_02.png

Javascript code :

var nombre = v_Total_01.toLocaleString("fr-FR");

And I show nombre in the Text Caption, instead of the variable v_Total_01...

It was so simple that I spent my all afternoon on this !!!...

...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 06, 2018 Dec 06, 2018

Copy link to clipboard

Copied

Je m'excuse, j'était en train de faire des Voice Overs

Félicitations!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Dec 06, 2018 Dec 06, 2018

Copy link to clipboard

Copied

LATEST

...

Je n'accepte pas tes excuses !!... Car tu n'as nul besoin de t'excuser !...

Par contre je prends tes félicitations !...

Et je te remercie encore de m'avoir mis sur la piste du "toLocaleString" sans quoi je serais encore à bidouiller !!...

Merci encore (et encore) donc !!...

...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Help resources