FloatifyFloatify is a VSCode extension for converting all non-specified floating point numbers in a C# file to floats on save. That is This is useful when programming games in engines such as Unity, where most floating point math is done with floats. Other C# game engines also use floats for most calculations, and having to write the f suffix on every number manually is slow and obtrusive. Do note: this extension may have some severe bugs. Please do not hesitate to suggest improvements in a GitHub issue. FeaturesNOTE: Read Requirements below for how to enable the plugin. On save converts all non-specified floating point numbers to floats instead of the default double. Before saving:
// After save:
This will auto-fix RequirementsAs this is a very intrusive and breaking extension for projects that are not using floats as the default we require a floatify.json file in any parent folder to the current script you are editing for this extension to have any effect. If this files contains the below .json the extension is enabled on save. NOTE: If this file does not exist this extension does NOTHING.
YOU ALSO need to enable code-actions on save by adding this to your
Known IssuesThis has problems identifying if numbers are inside strings. Release NotesUsers appreciate release notes as you update your extension. 0.0.4Working release with some known bugs. Fixed handling of negative numbers. 0.0.1Initial release with known bugs |