10
I have the following digit line:
74893.12004 21627.007186 37931.981056 7 60750000001400
As already seen in this question, I figured out how to calculate the salary mathematically:
Need the equivalent in JS, which is to extract the maturity factor (the first four characters of the last block, in the example above 6075), and add this number to the date 7/10/1997 (the date 7 October 1997 is always this, the basis of all the standard boletos Febraban), obtaining maturity in the format dd/mm/yyyy.
Example: for factor 1001 the resulting date has to be 4/07/2000.
you have already managed to extract only the field related to the maturity code?
– Erlon Charles
@Bacco, the other question was for Delphi, how do I do it in java ?
– user7605
@user7605 you want java or javascript?
– Erlon Charles
@Erlon, I have already used the: test.substr(40,4);
– user7605
@Erloncharles, JAVASCRIPT..
– user7605
@Bacco posted there as comment the link of the other question
– Erlon Charles
@user7605 I will try to save your question, if you don’t like the editing, you can reverse it later.
– Bacco
Okay @Bacco, thank you for your attention. Remembering that I need to convert this code that contains the MATURITY in the correct expiration date in the style xx/xx/xxxx ok ?
– user7605
@Erloncharles, in Delphi would look like this: Result := Strtodate('07/10/1997') + Strtoint(Copy(Codigobarras, 41, 4))..
– user7605
Great @Bacco, thanks!
– user7605
@user7605 when asking next questions, try to be clear this way, and focus on the main problem, so help everyone (and we can help you better).
– Bacco
Good question, didn’t know it was possible :)
+1
– Silvio Andorinha
Thank you @Bacco....
– user7605
See also this link: http://boletobancario-codigodebarras.blogspot.com.br/
– user622