Skip to content

Instantly share code, notes, and snippets.

<link rel="import" href="../topeka-elements/category-icons.html">
<link rel="import" href="../core-icon/core-icon.html">
<link rel="import" href="../topeka-elements/theme.html">
<link rel="import" href="../topeka-elements/topeka-resources.html">
<link rel="import" href="../topeka-elements/topeka-app.html">
<link rel="import" href="../topeka-elements/topeka-datasource.html">
<link rel="import" href="../core-menu/core-submenu.html">
<link rel="import" href="../core-item/core-item.html">
<polymer-element name="my-element">
@MaximShoustin
MaximShoustin / extension-helper.swift
Created September 16, 2014 21:18
Extension Helper
import Foundation
extension Double {
func format(f: String) -> String {
return NSString(format: "%\(f)f", self)
}
func toString() -> String {
return String(format: "%.1f",self)
}
/*
Converts A class to a dictionary, used for serializing dictionaries to JSON
Supported objects:
- Serializable derived classes
- Arrays of Serializable
- NSData
- String, Numeric, and all other NSJSONSerialization supported objects