September 2017 Update
This commit is contained in:
parent
bba7bfd280
commit
ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions
19
Task/SEDOLs/Cache-ObjectScript/sedols.cos
Normal file
19
Task/SEDOLs/Cache-ObjectScript/sedols.cos
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
Class Utils.Check [ Abstract ]
|
||||
{
|
||||
|
||||
ClassMethod SEDOL(x As %String) As %Boolean
|
||||
{
|
||||
// https://en.wikipedia.org/wiki/SEDOL
|
||||
IF x'?1(7N,1U5UN1N) QUIT 0
|
||||
IF x'=$TRANSLATE(x,"AEIOU") QUIT 0
|
||||
SET cd=$EXTRACT(x,*), x=$EXTRACT(x,1,*-1)
|
||||
SET wgt="1317391", t=0
|
||||
FOR i=1:1:$LENGTH(x) {
|
||||
SET n=$EXTRACT(x,i)
|
||||
IF n'=+n SET n=$ASCII(n)-55
|
||||
SET t=t+(n*$EXTRACT(wgt,i))
|
||||
}
|
||||
QUIT cd=((10-(t#10))#10)
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue