jawbreaker Posted August 29, 2014 Group: Members Topic Count: 13 Topics Per Day: 0.00 Content Count: 68 Reputation: 1 Joined: 06/21/14 Last Seen: August 8, 2022 Share Posted August 29, 2014 Can you help me with message display or announce display format? Thank you mes "How much do you buy it?"; input .@price; next; mes "Buying Price: ^FF0000"+.@price+"^000000z"; // sample: if i input: 1000000 // This will display: // Buying Price: 1000000z // How can i make it to this format: // Buying Price: 1m // Buying Price: 1.1m // Buying Price: 600k // Buying Price: 1,000,000z Quote Link to comment Share on other sites More sharing options...
Emistry Posted August 29, 2014 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2369 Joined: 10/28/11 Last Seen: Sunday at 05:32 PM Share Posted August 29, 2014 npc/other/Global_Functions.txt ////////////////////////////////////////////////////////////////////////////////// // Returns a number with commas between every three digits. // -- callfunc "F_InsertComma",<number> // Examples: // callfunc("F_InsertComma",7777777) // returns "7,777,777" ////////////////////////////////////////////////////////////////////////////////// function script F_InsertComma { set .@str$, getarg(0); for (set .@i,getstrlen(.@str$)-3; .@i>0; set .@i,.@i-3) set .@str$, insertchar(.@str$,",",.@i); return .@str$; } use this. 1 Quote Link to comment Share on other sites More sharing options...
Question
jawbreaker
Can you help me with message display or announce display format?
Thank you
mes "How much do you buy it?";
input .@price;
next;
mes "Buying Price: ^FF0000"+.@price+"^000000z";
// sample: if i input: 1000000
// This will display:
// Buying Price: 1000000z
// How can i make it to this format:
// Buying Price: 1m
// Buying Price: 1.1m
// Buying Price: 600k
// Buying Price: 1,000,000z
Link to comment
Share on other sites
1 answer to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.