Schau ins help bei "binval"
da mußt du zwar die 0/1 als string anbieten, aber das sollt ja kein problem sein