Hi how's everything? I hope it's ok.
You see, there is a way to manually format numbers for what you are looking for although it has to be done through coding.
I'll explain basically what it is, and how it worked for me.
Let's take any number with more than 4 digits, why 4 digits? because we will place the point for thousands units every 3 digits (or the comma to taste, although I prefer to reserve the comma for decimals and the point for thousand units).
1) First you have to convert the number into a text string.
2) then you have to read the resulting string from right to left, that is, from ones to hundreds, and so on. I use a FOR NEXT loop.
3) We place the first unit figure on the screen, and then we count them by grouping them three by three. For every three figures we will add the point that marks the thousand units with respect to the previous group of three figures. NOTE: taking into account that three figures are hundreds, that is, we will only add that thousand point if that fourth figure exists (1 unit + 3 figures to its left = 1 thousand unit). Example: we will put 1,000, not .999 (in addition to looking strange, it is confused with a decimal number)
Let's get to the nougat: (example code taken from Capt. Nemo)
Dim Score 'for your Score
Score = 0
Dim CadenaPuntos 'variable que almacena el valor en String de la variable numerica Score
CadenaPuntos = ""
Dim parametro 'variable que pasa el valor en String de la variable CadenaPuntos a las Subs ConversorDigital y ConversorDigitalUdMil
parametro = ""
Dim GraficoNumerico 'devuelve la conversion del caracter de cadena de texto en string de las dos Subs anteriores, en un valor de string del gráfico png
GraficoNumerico = ""
Dim GraficoNumerico_ud
GraficoNumerico_ud = ""
Dim GraficoNumerico_dec
GraficoNumerico_dec = ""
Dim DigitosDMD 'los indices de las Array comienzan en 0 para el primer digit1
DigitosDMD = Array(digit1, digit2, digit3, digit4, digit5, digit6, digit7, digit8, digit9, digit10, digit11, digit12, digit13)
'NOTA: Usaremos 13 dígitos, es decir Score = (0 = 0.000.000.000.000 - 9.999.999.999.999) Usa tú los que necesites.
Dim indiceCadena 'inidice que recorre la cadena de la puntuación convertida en caracter de derecha a izda. y la coloca en los flasher del DMD
indiceCadena = 0
Dim CuentaUnidades
CuentaUnidades = 0
Dim Multiplier 'for playfield multipliers
Multiplier = 1 'todo numero multiplicado por cero es cero -> (N * 0) = 0; todo numero multiplicado por 1 es el mismo número -> (N * 1) = N;
Sub AddScore(points) 'we also need to Dim Score in the beginning of script. all Variables should go in the beginning of script.
Score = Score + (points * Multiplier)
'prevenir overflow, dar vuelta al marcador
'guarda record máximo prefijado como en los Game and Watch
If Score >= 9999999999999 Then
'New Record obtenido, asignación manual y guardado de nuevo Record
HighScore = 9999999999999
Savehs
'reinicia el marcador
Score = Score - HighScore 'continuar con el marcador sin el desbordamiento, es lo mismo que poner Score = 0
End If
'conversion de Score a String
CadenaPuntos = CStr(Score)
'primera unidad de CadenaPuntos fuera del bucle For Next
ConversorDigital( Mid(StrReverse(CadenaPuntos),1,1) ) 'funciona
DigitosDMD(0).ImageA = GraficoNumerico 'así usa el primer espacio, el de indice 0 inicial del Array
'nota, hay un desfase de -1 entre el indice de la cadena String (1..13) y el indice del Array (0..12) ajustar el desfase con DigitosDMD(indiceCadena -1)
'inicia contador de unidades de millar
CuentaUnidades = 0
If Len(CadenaPuntos) > 1 And Len(CadenaPuntos) <= 13 Then '> 1 si hay decenas o más, <= 13 ancho máximo del display Score DMD (digit13) evita error de overflow
For indiceCadena = 2 to Len(CadenaPuntos)
CuentaUnidades = CuentaUnidades + 1
If CuentaUnidades = 3 Then 'unidad de millar, teniendo en cuenta que ya hemos saltado el primer dígito de unidad de forma manual
ConversorDigitalUdMil( Mid(StrReverse(CadenaPuntos),indiceCadena,1) ) 'funciona
DigitosDMD(indiceCadena -1).ImageA = GraficoNumerico
CuentaUnidades = 0
Else 'son decenas o centenas
ConversorDigital( Mid(StrReverse(CadenaPuntos),indiceCadena,1) ) 'funciona
'para evitar que invierta el orden de la cifra (123 ptos se convierten en grafico 321) se usa la funcion StrReverse
'dibuja cada flasher del DMD de puntuacion, recorriendolos de derecha a izda.
'muestra solo el digito de unidades, como si el indiceCadena no avanzada a la derecha del digito anterior
DigitosDMD(indiceCadena -1).ImageA = GraficoNumerico
End If 'unidades de millar
Next 'indiceCadena
End If 'Len > 1
End If
End Sub 'AddScore
Sub ConversorDigital(parametro) 'sub para convertir de caracter de cadena de texto string a gráfico png
'NOTA: estos graficos son sólo de dígitos numéricos (0) al (9)
Select Case parametro
'numéricos
Case ""
GraficoNumerico = "d_spc"
Case "0"
GraficoNumerico = "d0_c"
Case "1"
GraficoNumerico = "d1_c"
Case "2"
GraficoNumerico = "d2_c"
Case "3"
GraficoNumerico = "d3_c"
Case "4"
GraficoNumerico = "d4_c"
Case "5"
GraficoNumerico = "d5_c"
Case "6"
GraficoNumerico = "d6_c"
Case "7"
GraficoNumerico = "d7_c"
Case "8"
GraficoNumerico = "d8_c"
Case "9"
GraficoNumerico = "d9_c"
End Select
End Sub
Sub ConversorDigitalUdMil(parametro) 'sub para convertir de caracter numérico con punto de unidades de millar, de cadena de texto string a gráfico png
'NOTA: estos graficos NO son sólo de números, el grafico ya incluye un punto detrás del digito correspondiente, por ejemplo del (0.) al (9.)
Select Case parametro
Case ""
GraficoNumerico = "d_spc"
Case "0"
GraficoNumerico = "d0a_c"
Case "1"
GraficoNumerico = "d1a_c"
Case "2"
GraficoNumerico = "d2a_c"
Case "3"
GraficoNumerico = "d3a_c"
Case "4"
GraficoNumerico = "d4a_c"
Case "5"
GraficoNumerico = "d5a_c"
Case "6"
GraficoNumerico = "d6a_c"
Case "7"
GraficoNumerico = "d7a_c"
Case "8"
GraficoNumerico = "d8a_c"
Case "9"
GraficoNumerico = "d9a_c"
End Select
End Sub
'Esto puede ser útil
Sub Limpia_Score_DMD 'limpa el DMD, sustituyendo cada flasher del DMD de Score por una imagen "en blanco" transparente, funciona como CLS
'nota, hay un desfase de -1 entre el indice de la cadena String (1..13) y el indice del Array (0..12) ajustar el desfase con DigitosDMD(indiceCadena -1)
For indiceCadena = 1 to 13 'el array de DigitosDMD 0..12
DigitosDMD(indiceCadena -1).ImageA = "d_spc"
Next 'indiceCadena
End Sub
If you are going to use a reel like in the older EMs, you need a point symbol, which replaces the corresponding digit, and run the next thousand unit to the left of that punctuation symbol. This would be like using base 11 notation (0 through 9 and the .) Something like (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, .)
Unless you leave the gap already made to mark the thousand units and graphically group the digits by 3. (something like 0.000.000.000.000 and move only the corresponding digits without altering the X.XXX.XXX place points. XXX,000).
As you can see, my solution is to exchange graphics in each thousand unit, for an equivalent graph that already has the mimllar unit point embedded. So the corresponding number is read "followed." I don't know if I explain myself.
Greetings.
EpeC.