Formatting numeric variables....
Aug 26, 2023
By
Carrie Eaton
Friends, it's been a number of years since I asked how to format numeric variables, ie commas and decimal place such as $17,200.
Has there been any progress on this in SL after all these years? Or has anyone found a way to do it? I've seen some references to Javascript, but that's not in my skillset, so if that's the only solution, can anyone explain and show examples of how/where to include it in SL? OR does anyone have something like this that can be purchased???
5 Replies
Hi Carrie,
There is still no way to format numbers like you want out-of-the-box in Storyline. JavaScript is still the way to go. Here are a couple of forum threads to get you started (though there are many more discussions on this):
https://community.articulate.com/discussions/articulate-storyline/how-to-display-2-decimal-places-in-variable-calculations
https://community.articulate.com/discussions/articulate-storyline/adding-commas-decimals-into-variable-values
If you want to post a single-slide Storyline file containing your specific case, I'll be happy to insert the JavaScript code for you. Just tell me the format you need (whole number? 2 decimal format for cents?).
with modern javascript it is not very complicated
part 1: converting the number (based on country code + currency)
part 2: connection to storyline variables
result:
https://360.articulate.com/review/content/3da26422-ecc6-4cbf-a097-e74bcad9924b/review
more infos:
Jurgen, I appreciate your input! But having zero experience with Javascript, this still looks complicated to me. ;-) I'm hoping that Steve will be able to help per his response above. Thank you!
Steve, I would appreciate your help, but is there a way I can send you a SL screen rather than posting it publicly here? It's a client file. I see a way to send you an email here in Heroes but not your actual email. Shall I send you my email that way so we can communicate directly? And no rush on this!
Send me a private message, Carrie, and I'll respond with my email so you can send me your file.