PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV Mobile 24 → Mascara format numeric field containing 1082001 in a string that is "1.08.2.001"
Mascara format numeric field containing 1082001 in a string that is "1.08.2.001"
Débuté par adrianoboller, 11 déc. 2014 16:40 - 3 réponses
Membre enregistré
3 006 messages
Popularité : +89 (91 votes)
Posté le 11 décembre 2014 - 16:40
How do I format numeric field containing 1082001 in a string that is "1.08.2.001" I will use the string to set the name of the PDF file that will be displayed 1.08.2.001.pdf by foxit

R .:

fileName is string = 1082001

IF Length (fileName) = 7
fileName = Middle (fileName, 1,1) + "." + Middle (fileName, 2,2) + "." + Middle (fileName, 4.1) + "." + Middle (fileName, 5.3)
ELSE IF Length (fileName) = 8
fileName = Middle (fileName, 1,2) + "." + Middle (fileName, 3,2) + "." + Middle (fileName, 5,1) + "." + Middle (fileName, 6.3)
END

fileName = 1.08.2.001
OR
fileName = 10.08.2.001


Como faço para formatar campo numerico contendo 1082001 em uma string que seja "1.08.2.001" vou usar a string para montar o nome do arquivo pdf 1.08.2.001.pdf que sera visualizado pelo foxit

R.:

nomeArquivo is string = 1082001

IF Length(nomeArquivo) = 7
nomeArquivo = Middle(nomeArquivo, 1,1) +"."+ Middle(nomeArquivo, 2,2) +"."+ Middle(nomeArquivo, 4,1) +"."+ Middle(nomeArquivo, 5,3)
ELSE IF Length(nomeArquivo) = 8
nomeArquivo = Middle(nomeArquivo, 1,2) +"."+ Middle(nomeArquivo, 3,2) +"."+ Middle(nomeArquivo, 5,1) +"."+ Middle(nomeArquivo, 6,3)
END

nomeArquivo = 1.08.2.001
OU
nomeArquivo = 10.08.2.001
Membre enregistré
3 006 messages
Popularité : +89 (91 votes)
Posté le 11 décembre 2014 - 16:43
OR

http://help.windev.com/

NumToString(123) // Returns "123"
NumToString(1.23) // Returns "1.23"
NumToString(12345.5, "+10.2f") // Returns " +12345.50"
NumToString(12345.5, "-+10.2f") // Returns "+12345.50 "
NumToString(12345.5, "+010.2f") // Returns "+012345.50"
NumToString(12345.5, "010.2f") // Returns "0012345.50"

NumToString(12345.5, "10.2fS")
// Returns " 12 345.50" (the thousand separator is " ")

NumToString(12345.5, "10,2fS")
// Returns " 12 345,50" (the decimal separator is ",")
Membre enregistré
3 006 messages
Popularité : +89 (91 votes)
Posté le 11 décembre 2014 - 16:44
Membre enregistré
3 006 messages
Popularité : +89 (91 votes)
Posté le 11 décembre 2014 - 17:27
valorString = NumToString(123455, "99.99.99")

valorString = NumToString(123455,"##.##.##")