Fixed format detection and share the value to view, fixes for #7.

Signed-off-by: crynobone <crynobone@gmail.com>